MonarQBackend#

class qiskit_calculquebec.backends.monarq_backend.MonarQBackend(machine_name: str = 'monarq', client: ApiClient = None)#

Bases: BackendV2

Custom 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 client is None or machine_name is not supported.

coupling_map

Return the CouplingMap object

dt

Return the system time resolution of input signals in seconds.

dtm

Return the system time resolution of output signals

instruction_durations

Return the InstructionDurations object.

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

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 Instruction instances that the backend supports.

options

Return the options for the backend

provider

Return the backend provider.

target

Return the backend target object.

version

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.

coupling_map#

Return the CouplingMap object

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 and Delay durations 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 InstructionDurations object.

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 Instruction instances 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:

provider

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 the Backend abstract interface.

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 — rewrites RY(±π/2) to native RY90 / RYm90 gates.

  • DelayToIdentityPass — expands every Delay into the equivalent number of IGate operations (1 IGate = 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 QubitProperties object for. This can be a single integer for 1 qubit or a list of qubits and a list of QubitProperties objects will be returned in the same order

Returns:

The QubitProperties object 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 be None.

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 DelayToIdentityPass after any external optimization, so Delay gates are always expanded into IGate sequences before reaching the hardware.

Parameters:
  • circuits – Circuit or list of circuits to execute.

  • **kwargs – Optional keyword arguments. shots sets 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: rewrites RY(±π/2) to native RY90 / RYm90 gates. - DelayToIdentityPass: expands Delay gates into IGate sequences. - Level-3 preset optimization passes.

Parameters:

circuit (QuantumCircuit) – Circuit to transpile.

Returns:

Transpiled circuit ready for execution.

Return type:

QuantumCircuit