Skip to content

Commit

Permalink
AbstractCircuits and FrozenCircuits (#3481)
Browse files Browse the repository at this point in the history
Partial reupload of #3445, following the method reordering submitted in #3478.

Commit history has been cleaned up to remove a misconfigured YAPF run from the previous upload. The following items have also been addressed:

@balopat 
> There are no tests protecting immutability for FrozenCircuit - I can just add a the method below to FrozenCircuit - making it mutable, and there are no tests broken.

Tests have been added to ensure `moments` and `devices` cannot be set with `=`.

@maffoo 
> [frozen_circuit_test.py] is almost entirely duplicated from {...} circuit_test.py. It seems like a better way to handle this would be to write a single test that is parameterized over whether to use a frozen circuit, e.g. {...}

Shared tests have been converted to parameterized tests in `circuit_test.py`. `frozen_circuit_test.py` now only contains tests for FrozenCircuit-specific behavior.
  • Loading branch information
95-martin-orion committed Nov 7, 2020
1 parent 512d256 commit debc6fb
Show file tree
Hide file tree
Showing 12 changed files with 1,155 additions and 530 deletions.
1 change: 1 addition & 0 deletions cirq/__init__.py
Expand Up @@ -66,6 +66,7 @@
from cirq.circuits import (
Circuit,
CircuitDag,
FrozenCircuit,
InsertStrategy,
PointOptimizationSummary,
PointOptimizer,
Expand Down
6 changes: 5 additions & 1 deletion cirq/circuits/__init__.py
Expand Up @@ -24,11 +24,15 @@
QuilOutput,)

from cirq.circuits.circuit import (
Circuit,)
AbstractCircuit,
Circuit,
)
from cirq.circuits.circuit_dag import (
CircuitDag,
Unique,
)
from cirq.circuits.frozen_circuit import (
FrozenCircuit,)
from cirq.circuits.insert_strategy import (
InsertStrategy,)

Expand Down

0 comments on commit debc6fb

Please sign in to comment.