laboneq_applications.experiments.two_qubit_irb
¶
This module defines a two-qubit interleaved randomized benchmarking experiment.
In this experiment, every random sequence of two-qubit Clifford gates is played twice: as it is, and with the interleaved gate after every Clifford. Each sequence ends with the recovery gate that returns the qubits to |00⟩ for perfect gates. Comparing the decays of the two kinds of sequences gives the error of the interleaved gate.
The experiment has the following pulse sequences, for every variation and length:
q0, q1 --- [ clifford sequence ] --- [ recovery gate ] --- [ measure ]
q0, q1 --- [ clifford sequence w/ interleaved gate ] --- [ recovery gate ] ---
[ measure ]
If multiple qubit pairs are passed, the above pulses are applied in parallel on all pairs. A different random Clifford sequence is played on each pair. Shorter sequences start later, so that every sequence ends right before the measurement.
InterleavedGateOptions
¶
Options for the tasks that need to know the interleaved gate.
Attributes:
| Name | Type | Description |
|---|---|---|
interleaved_gate |
Literal['iswap', 'cz', 'cx']
|
The gate to interleave within the RB sequences. A quantum operation of
the same name must implement it, unless
With Default: |
experiment_workflow(session, qpu, qubit_pairs, *, length_cliffords, variations=1, seed=None, gate_map=None, temporary_parameters=None, options=None)
¶
The IRB Workflow for two qubits coupled by a tunable coupler.
The workflow consists of the following steps:
- validate_interleaved_gate_edges
- generate_irb_sequences
- flatten_qubit_pairs
- create_experiment
- compile_experiment
- run_experiment
- analysis_workflow
Changed in version 27.1.0
The experiment moved out of contrib and no longer needs Qiskit.
- The workflow is named
two_qubit_irbinstead oftwo_qubit_coupler_irband takes TuneUpWorkflowOptions instead ofTwoQubitCouplerIRBWorkflowOptions. - It plays every pair passed instead of only the first, each with its own random Clifford sequences, so the pairs must not share qubits.
- All arguments apart from
session,qpuandqubit_pairsare keyword arguments, andseedis new. gate_mapreplaces the default gate map instead of extending it.- It creates its experiment with the
create_experimenttask of the two-qubit RB experiment, and resets the qubits actively when theactive_resetoption is set instead ofadd_reset. - It takes single-shot, discriminated data by default, and raises an error
for other values of the
averaging_modeandacquisition_typeoptions. create_irb_sequencesis now generate_irb_sequences, andcreate_qasm_qubit_map,register_qasm_operations,create_qasm_batch_experimentandMultiQASMProgramOptionsare gone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
The connected session to use for running the experiment. |
required |
qpu
|
QPU
|
The qpu consisting of the original qubits, tunable couplers and quantum operations. |
required |
qubit_pairs
|
list[list[str]]
|
The pairs of qubits to run the experiments on. Each pair must be a list of two qubit UIDs. |
required |
length_cliffords
|
list[int]
|
List of the numbers of Clifford gates to sweep. |
required |
variations
|
int
|
Number of random sequences per sequence length. |
1
|
seed
|
int | None
|
The seed of the random sequences. The sequences of a pair depend only on the seed and the UIDs of its qubits. Default is None and provides a random seed. |
None
|
gate_map
|
dict | None
|
Maps the native gates |
None
|
temporary_parameters
|
dict[str, dict | QuantumParameters] | None
|
The temporary parameters with which to update the qubit-pair parameters for the duration of the experiment. |
None
|
options
|
TuneUpWorkflowOptions | None
|
The options for building the workflow, passed as an instance of TuneUpWorkflowOptions. In addition to options from WorkflowOptions, the following custom options are supported:
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
result |
None
|
The result of the workflow. |
Example
options = experiment_workflow.options()
options.count(10)
options.interleaved_gate("iswap")
result = experiment_workflow(
session=session,
qpu=qpu,
qubit_pairs=[["q0", "q1"]],
length_cliffords=[1, 5, 10, 20, 50],
variations=5,
options=options,
).run()
generate_irb_sequences(qubit_pairs, length_cliffords, variations=1, gate_map=None, seed=None, options=None)
¶
Creates the standard and interleaved RB sequences of each pair as gates.
For every variation and length, draws one sequence of uniformly random
two-qubit Cliffords and returns it twice: as it is, and with the interleaved
gate after every Clifford. Both sequences end with the Clifford that inverts
them. Each Clifford takes the fewest interleaved gates, then the fewest
pulses, that the gates of gate_map allow. Every pair gets its own sequences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qubit_pairs
|
list[list[str]]
|
List of [q0, q1] pairs to create the sequences for, passed by UID. |
required |
length_cliffords
|
list
|
A list of RB sequence lengths (number of 2-qubit Cliffords). |
required |
variations
|
int
|
Number of random sequences per sequence length. |
1
|
gate_map
|
dict | None
|
Maps the native gates |
None
|
seed
|
int | None
|
The seed of the random sequences. The sequences of a pair depend only on the seed and the UIDs of its qubits. |
None
|
options
|
InterleavedGateOptions | None
|
The options for this task, passed as an instance of InterleavedGateOptions. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, tuple[list[tuple], ...]]
|
A dictionary of Clifford sequences, keyed by |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
validate_interleaved_gate_edges(qpu, qubit_pairs, options=None)
¶
Checks that every pair has a flux-driven edge for the interleaved gate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpu
|
QPU
|
The QPU, whose topology holds the edges between the qubits. |
required |
qubit_pairs
|
list[list[str]]
|
List of [q0, q1] pairs, passed by UID. |
required |
options
|
InterleavedGateOptions | None
|
The options for this task, passed as an instance of InterleavedGateOptions. |
None
|
Raises:
| Type | Description |
|---|---|
KeyError
|
If a pair has no edge tagged with the interleaved gate. |
ValueError
|
If the quantum element of an edge has no flux line. |