MonarQBackend#
- class qiskit_calculquebec.backends.monarq_backend.MonarQBackend(machine_name: str = 'monarq', client: ApiClient = None)#
Bases:
BackendV2Custom backend for the Yukon 6-qubit device.
Features: - Integrates with Calcul Québec API - Validates measurement placement - Supports multi-circuit jobs with MultiMonarQJob - Transpilation includes automatic RY(±π/2) replacement - Delay gates are automatically expanded into IGate sequences
Initialize the MonarQ backend.
- Parameters:
machine_name (str) – Target device:
"monarq"(24 qubits) or"yukon"(6 qubits). Default:"monarq".client (ApiClient) – Authenticated API client. Required.
- Raises:
ValueError – If
clientisNoneormachine_nameis not supported.
Attributes
Return the
CouplingMapobjectReturn the system time resolution of input signals in seconds.
Return the system time resolution of output signals
Return the
InstructionDurationsobject.A list of Instruction tuples on the backend of the form
(instruction, (qubits))Return the maximum number of circuits that can be submitted at once.
Return the grouping of measurements which are multiplexed
Return the number of qubits the backend has.
A list of instruction names that the backend supports.
A list of
Instructioninstances that the backend supports.Return the options for the backend
Return the backend provider.
Return the backend target object.
Name of the backend.
Optional human-readable description.
Date that the backend came online.
Version of the backend being provided.
- coupling_map#
Return the
CouplingMapobject
- dt#
Return the system time resolution of input signals in seconds.
This value (
dt) is the hardware clock cycle used by the Qiskit transpiler to convert gate andDelaydurations expressed in seconds into integer multiples of the hardware timestep.- Returns:
Clock period in seconds (32 ns for Anyon devices).
- Return type:
float
- dtm#
Return the system time resolution of output signals
- Returns:
The output signal timestep in seconds.
- Raises:
NotImplementedError – if the backend doesn’t support querying the output signal timestep
- instruction_durations#
Return the
InstructionDurationsobject.
- instructions#
A list of Instruction tuples on the backend of the form
(instruction, (qubits))
- max_circuits#
Return the maximum number of circuits that can be submitted at once.
- meas_map#
Return the grouping of measurements which are multiplexed
This is required to be implemented if the backend supports Pulse scheduling.
- Returns:
The grouping of measurements which are multiplexed
- Raises:
NotImplementedError – if the backend doesn’t support querying the measurement mapping
- num_qubits#
Return the number of qubits the backend has.
- operation_names#
A list of instruction names that the backend supports.
- operations#
A list of
Instructioninstances that the backend supports.
- options#
Return the options for the backend
The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the
run()method.
- provider#
Return the backend provider.
- Returns:
the provider responsible for the backend.
- Return type:
- target#
Return the backend target object.
- version = 2#
- name#
Name of the backend.
- description#
Optional human-readable description.
- online_date#
Date that the backend came online.
- backend_version#
Version of the backend being provided. This is not the same as
BackendV2.version, which is the version of theBackendabstract interface.
Methods
get_pass_manager([optimization_level])Return a fully configured pass manager for this backend.
qubit_properties(qubit)Return QubitProperties for a given qubit.
run(circuits, **kwargs)Submit circuits to the backend and return a MultiMonarQJob.
set_options(**fields)Set the options fields for the backend
transpile(circuit)Transpile a circuit for this backend at optimization level 3.
- get_pass_manager(optimization_level: int = 3) StagedPassManager#
Return a fully configured pass manager for this backend.
This is the recommended way to transpile circuits intended for MonarQ/Yukon. It wraps
generate_preset_pass_manager()and injects the two backend-specific transformation passes:ReplaceRYPass— rewritesRY(±π/2)to nativeRY90/RYm90gates.DelayToIdentityPass— expands everyDelayinto the equivalent number ofIGateoperations (1IGate= 1 dt = 32 ns).
- Parameters:
optimization_level (int) – Preset optimisation level passed to
generate_preset_pass_manager()(0–3). Default: 3.- Returns:
A staged pass manager ready to call
.run(circuit).- Return type:
StagedPassManager
Example
pm = backend.get_pass_manager(optimization_level=3) transpiled_qc = pm.run(qc) sampler = Sampler(mode=backend) job = sampler.run([transpiled_qc], shots=1000)
- qubit_properties(qubit: int | list[int]) QubitProperties | list[QubitProperties]#
Return QubitProperties for a given qubit.
If there are no defined or the backend doesn’t support querying these details this method does not need to be implemented.
- Parameters:
qubit – The qubit to get the
QubitPropertiesobject for. This can be a single integer for 1 qubit or a list of qubits and a list ofQubitPropertiesobjects will be returned in the same order- Returns:
The
QubitPropertiesobject for the specified qubit. If a list of qubits is provided a list will be returned. If properties are missing for a qubit this can beNone.- Raises:
NotImplementedError – if the backend doesn’t support querying the qubit properties
- run(circuits, **kwargs)#
Submit circuits to the backend and return a MultiMonarQJob.
Automatically applies
DelayToIdentityPassafter any external optimization, soDelaygates are always expanded intoIGatesequences before reaching the hardware.- Parameters:
circuits – Circuit or list of circuits to execute.
**kwargs – Optional keyword arguments.
shotssets the number of shots to execute (capped at 1024).
- set_options(**fields)#
Set the options fields for the backend
This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
- Parameters:
fields – The fields to update the options
- Raises:
AttributeError – If the field passed in is not part of the options
- transpile(circuit)#
Transpile a circuit for this backend at optimization level 3.
Applies: -
ReplaceRYPass: rewritesRY(±π/2)to nativeRY90/RYm90gates. -DelayToIdentityPass: expandsDelaygates intoIGatesequences. - Level-3 preset optimization passes.- Parameters:
circuit (QuantumCircuit) – Circuit to transpile.
- Returns:
Transpiled circuit ready for execution.
- Return type:
QuantumCircuit