laboneq.workflow.tasks.create_qasm_experiment
¶
This module provides a task to create an experiment from an OpenQASM program.
create_qasm_batch_experiment(qpu, programs, qubit_map, inputs=None, externs=None, options=None)
¶
A task to create a QASM batch experiment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpu
|
QPU
|
The quantum processing unit to create the experiment for. |
required |
programs
|
list[str]
|
List of OpenQASM program. |
required |
qubit_map
|
dict[str, QuantumElement | list[QuantumElement]]
|
A map from OpenQASM qubit names to LabOne Q DSL Qubit objects. The values can either be a single qubit or a list of qubits in case of an qubit register. |
required |
inputs
|
dict[str, Any] | None
|
Inputs to the program. |
None
|
externs
|
dict[str, Callable | Port] | None
|
A mapping for program extern definitions. Externs may be either functions (Python |
None
|
options
|
SingleProgramOptions | dict | None
|
Optional settings for the LabOne Q Experiment. Default: MultiProgramOptions Accepts also a dictionary with the following items: count: The number of acquire iterations. acquisition_mode: The mode of how to average the acquired data. acquisition_type:
The type of acquisition to perform.
The acquisition type may also be specified within the
OpenQASM program using reset_oscillator_phase: When true, reset all oscillators at the start of every acquisition loop iteration. repetition_time:
The minimum duration of any single program.
If batch_execution_mode: The execution mode for the sequence of programs. Can be any of the following.
do_reset:
If Note: Requires add_measurement:
If Note: Requires pipeline_chunk_count: The number of pipeline chunks to divide the experiment into. |
None
|
Returns:
| Type | Description |
|---|---|
Experiment
|
A LabOne Q Experiment. |
Raises:
| Type | Description |
|---|---|
ValueError
|
Supplied qubit(s) does not exists in the QPU. |
OpenQasmException
|
The program cannot be transpiled. |
create_qasm_experiment(qpu, program, qubit_map, inputs=None, externs=None, options=None)
¶
A task to create a QASM experiment.
This task is used to create a QASM experiment for execution on a quantum processor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpu
|
QPU
|
The quantum processing unit to create the experiment for. |
required |
program
|
str
|
OpenQASM program. |
required |
qubit_map
|
dict[str, QuantumElement | list[QuantumElement]]
|
A map from OpenQASM qubit names to LabOne Q DSL Qubit objects. The values can either be a single qubit or a list of qubits in case of an qubit register. |
required |
inputs
|
dict[str, Any] | None
|
Inputs to the program. |
None
|
externs
|
dict[str, Callable | Port] | None
|
A mapping for program extern definitions. Externs may be either functions (Python |
None
|
options
|
SingleProgramOptions | dict | None
|
Optional settings for the LabOne Q Experiment. Default: SingleProgramOptions Accepts also a dictionary with following items: count: The number of acquire iterations. acquisition_mode: The mode of how to average the acquired data. acquisition_type:
The type of acquisition to perform.
The acquisition type may also be specified within the
OpenQASM program using reset_oscillator_phase: When true, reset all oscillators at the start of every acquisition loop iteration. |
None
|
Returns:
| Type | Description |
|---|---|
Experiment
|
A LabOne Q Experiment. |
Raises:
| Type | Description |
|---|---|
ValueError
|
Supplied qubit(s) does not exists in the QPU. |
OpenQasmException
|
The program cannot be transpiled. |