laboneq_applications.contrib.experiments.single_qubit_randomized_benchmarking
¶
This module defines a randomized benchmarking experiment.
In this experiment, ...
The experiment has the following pulse sequence:
qb --- [clifford sequence] --- [recovery gate] --- [ measure ]
If multiple qubits are passed to the run
workflow, the above pulses are applied
in parallel on all the qubits.
Note that in the current implementation, the same Clifford sequences are applied on all qubits.
create_experiment(qpu, qubits, qasm_rb_sequences, gate_map, options=None)
¶
Creates an Amplitude Rabi Experiment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qpu |
QPU
|
The qpu consisting of the original qubits and quantum operations. |
required |
qubits |
Qubits
|
The qubits to run the experiments on. May be either a single qubit or a list of qubits. |
required |
qasm_rb_sequences |
list
|
RB sequences as QASM experiments. |
required |
gate_map |
dict
|
Dictionary to define the native gate set in QASM and the corresponding quantum_operations's in LabOne Q. Default: {"id":None, "sx":"x90", "x":"x180", "rz":"rz"}. |
required |
options |
TuneupExperimentOptions | None
|
The options for building the workflow. In addition to options from [WorkflowOptions], the following custom options are supported: - create_experiment: The options for creating the experiment. |
None
|
Returns:
Name | Type | Description |
---|---|---|
experiment |
Experiment
|
The generated LabOne Q experiment instance to be compiled and executed. |
Raises:
Type | Description |
---|---|
ValueError
|
|
Example
options = TuneupExperimentOptions()
options.count = 10
setup = DeviceSetup()
qpu = QPU(
qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
create_experiment(
qpu=qpu,
qubits=temp_qubits,
length_cliffords=[1,5,10,20,50],
variations=5,
options=options,
)
create_sq_rb_qasm(length_cliffords, gate_map, variations=1, seed=None, options=None)
¶
Creates RB sequences as QASM experiments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length_cliffords |
list
|
A list of RB sequences lengths. |
required |
gate_map |
dict
|
Dictionary to define the native gate set in QASM and the corresponding quantum operations in LabOne Q. |
required |
variations |
int
|
Number of samples to generate for each sequence length. |
1
|
seed |
int | None
|
A seed used to initialize numpy.random.default_rng when generating circuits. |
None
|
options |
TuneupExperimentOptions | None
|
The options for building the workflow. In addition to options from [WorkflowOptions], the following custom options are supported: - create_experiment: The options for creating the experiment. |
None
|
Returns:
Name | Type | Description |
---|---|---|
experiment |
list
|
The generated LabOne Q experiment instance to be compiled and executed. |
experiment_workflow(session, qpu, qubits, length_cliffords, variations=1, seed=None, gate_map=None, options=None)
¶
The Randmized Benchmarking Workflow for single qubits.
The workflow consists of the following steps:
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 and quantum operations. |
required |
qubits |
Qubits
|
The qubits to run the experiments on. May be either a single qubit or a list of qubits. |
required |
length_cliffords |
list
|
list of numbers of Clifford gates to sweep |
required |
variations |
int
|
Number of random seeds for RB. |
1
|
seed |
int | None
|
A seed used to initialize numpy.random.default_rng when generating circuits. Default is None and provides a random seed. |
None
|
gate_map |
dict | None
|
Dictionary to define the native gate set in QASM and the corresponding quantum_operations's in LabOne Q. Default: {"id":None, "sx":"x90", "x":"x180", "rz":"rz"}. |
None
|
options |
TuneUpWorkflowOptions | None
|
The options for building the workflow. In addition to options from [WorkflowOptions], the following custom options are supported: - create_experiment: The options for creating the experiment. |
None
|
Returns:
Name | Type | Description |
---|---|---|
result |
None
|
The result of the workflow. |
Example
options = experiment_workflow.options()
options.count(10)
options.transition("ge")
qpu = QPU(
qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
result = experiment_workflow(
session=session,
qpu=qpu,
qubits=temp_qubits,
length_cliffords=[1,5,10,20,50],
variations=5,
options=options,
).run()