Skip to content

Commit 837ad42

Browse files
authored
The number of exponents is too damn high (quantumlib#5456)
Just going to throw this out there for comment. `assist_consistent_protocols` is used in a huge number of tests (many of which are themselves parameterized tests). We test all of the protocols for a large number of different `pow`ed versions of the gate. This ends up being something like 10% or our test time. I've reduced this number down to what I think is a bit more reasonable, (0, itself, inverse, a non-zero float, a symbol).
1 parent 66459ea commit 837ad42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cirq/testing/consistent_protocols.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
def assert_implements_consistent_protocols(
4343
val: Any,
4444
*,
45-
exponents: Sequence[Any] = (0, 1, -1, 0.25, -0.5, 0.1, sympy.Symbol('s')),
45+
exponents: Sequence[Any] = (0, 1, -1, 0.25, sympy.Symbol('s')),
4646
qubit_count: Optional[int] = None,
4747
ignoring_global_phase: bool = False,
4848
setup_code: str = 'import cirq\nimport numpy as np\nimport sympy',
@@ -79,7 +79,7 @@ def assert_implements_consistent_protocols(
7979
def assert_eigengate_implements_consistent_protocols(
8080
eigen_gate_type: Type[ops.EigenGate],
8181
*,
82-
exponents: Sequence[value.TParamVal] = (0, 0.5, 1, -1, 0.25, -0.5, 0.1, sympy.Symbol('s')),
82+
exponents: Sequence[value.TParamVal] = (0, 1, -1, 0.25, sympy.Symbol('s')),
8383
global_shifts: Sequence[float] = (0, -0.5, 0.1),
8484
qubit_count: Optional[int] = None,
8585
ignoring_global_phase: bool = False,

0 commit comments

Comments
 (0)