From f876a11122cdc314e5196d40a86702c92d6ee837 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Mon, 12 Jan 2026 14:16:40 +0100 Subject: [PATCH] limit the max gates like in the paper --- src/tf-qas.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tf-qas.py b/src/tf-qas.py index e7b2a80..645778d 100755 --- a/src/tf-qas.py +++ b/src/tf-qas.py @@ -259,6 +259,8 @@ def sample_circuit(rng: random.Random, qubits: int, depth: int) -> QuantumCircui gates: list[list[Gate]] = [] 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 = rng.randint(1, 3) gate_locations = even if rng.random() < 0.5 else odd