limit the max gates like in the paper
This commit is contained in:
parent
147267eff1
commit
f876a11122
1 changed files with 2 additions and 0 deletions
|
|
@ -259,6 +259,8 @@ def sample_circuit(rng: random.Random, qubits: int, depth: int) -> QuantumCircui
|
||||||
|
|
||||||
gates: list[list[Gate]] = []
|
gates: list[list[Gate]] = []
|
||||||
for _ in range(depth):
|
for _ in range(depth):
|
||||||
|
if total_single + total_double >= 36:
|
||||||
|
break
|
||||||
gate_type_offset = 3 if rng.random() < TWO_QUBIT_GATE_PROBABILITY else 0
|
gate_type_offset = 3 if rng.random() < TWO_QUBIT_GATE_PROBABILITY else 0
|
||||||
gate_type = rng.randint(1, 3)
|
gate_type = rng.randint(1, 3)
|
||||||
gate_locations = even if rng.random() < 0.5 else odd
|
gate_locations = even if rng.random() < 0.5 else odd
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue