Skip to content

Consider creating a builder class for constructing circuits? #6050

Open
@tanujkhattar

Description

@tanujkhattar

Description of the issue
We have often discussed in the past the need for a builder pattern for constructing circuits, for example see #3246 and #2775.

#6013 made a first attempt of abstracting out an important piece of circuit construction code into a free function - get_earliest_accommodating_moment_index.

This issue to discuss:

  1. Where to best put the free function get_earliest_accommodating_moment_index.
  2. Create a new circuit builder class that can generalize the utility provided by get_earliest_accommodating_moment_index and can be used in both Circut._load_contents_with_earliest_strategy and _stratify_circuit for efficiently constructing new circuits.

Cirq version

1.2.0.dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/circuitskind/design-issueA conversation around designkind/healthFor CI/testing/release process/refactoring/technical debt itemsstatus/needs-agreed-designWe want to do this, but it needs an agreed upon design before implementationtriage/needs-more-evidence[Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions