Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ Results:
```

Explore more examples in the ready-made JSON schemas under ``metriq_gym/schemas/examples/``.
The updated WIT configuration exposes the generalized wormhole parameters
(e.g., ``n_qubits_per_side`` and ``insert_message_method``), letting you dial in new circuit sizes without
touching the Python code.

## Documentation

Expand Down
16 changes: 14 additions & 2 deletions docs/source/cli_workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,20 @@ Suites run multiple benchmarks together. Author ``suite.json`` like:
"name": "wit_7_qubits",
"config": {
"benchmark_name": "WIT",
"num_qubits": 7,
"shots": 1000
"shots": 1000,
"n_qubits_per_side": 3,
"message_size": 1,
"insert_message_method": "swap",
"interaction_coupling_strength": 1.5707963267948966,
"x_rotation_transverse_angle": 0.7853981633974483,
"zz_rotation_angle": 0.7853981633974483,
"z_rotation_angles": [
0.0283397,
0.00519953,
0.0316079
],
"time_steps": 3,
Comment on lines +77 to +88
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to give this much freedom in the parameters? Can't we simplify and have defaults for all parameters except the num of qubits?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely not. I think we can keep this level of specification strictly to the benchmark logic itself and not necessarily expose it to the user. Done.

"num_qubits": 7
}
}
]
Expand Down
104 changes: 71 additions & 33 deletions docs/source/end_to_end_tutorial.ipynb

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Quick Start

.. note::
If the default branch or file location changes, update the URL above accordingly.
The example config uses ``n_qubits_per_side = 3`` with ``insert_message_method = "swap"``, producing
a seven-qubit circuit consistent with the original benchmark. Adjust these parameters to explore other
circuit sizes.
3. Dispatch the benchmark to a local simulator:

.. code-block:: sh
Expand Down
10 changes: 6 additions & 4 deletions metriq_gym/benchmarks/mirror_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,20 +335,22 @@ def pauli_from_layer(pauli_layer: QuantumCircuit) -> Pauli:
n = pauli_layer.num_qubits
per_qubit = ["I"] * n # default all identity

for instr, qargs, _ in pauli_layer.data:
name = instr.name.lower()
for instruction in pauli_layer.data:
op = instruction.operation
qargs = instruction.qubits
name = op.name.lower()
if name in ("barrier", "delay", "measure"):
continue # middle layer shouldn't have these, but be permissive
if len(qargs) != 1:
raise ValueError(f"Non-1q op '{instr.name}' found in middle_pauli layer.")
raise ValueError(f"Non-1q op '{op.name}' found in middle_pauli layer.")
# Get the circuit's index for this qubit (portable across Terra versions)
q = pauli_layer.find_bit(qargs[0]).index
if name in ("x", "y", "z"):
per_qubit[q] = name.upper()
elif name in ("id", "i"):
per_qubit[q] = "I"
else:
raise ValueError(f"Non-Pauli op '{instr.name}' found in middle_pauli layer.")
raise ValueError(f"Non-Pauli op '{op.name}' found in middle_pauli layer.")

label = "".join(per_qubit[::-1])
return Pauli(label)
Expand Down
Loading