This top level module contains the main qBraid public functionality.

Data Types

QPROGRAM(*contents, strategy=cirq.InsertStrategy.EARLIEST) = Type alias defining all supported quantum circuit / program types

A mutable list of groups of operations to apply to some qubits.

Methods returning information about the circuit (inherited from AbstractCircuit):

  • next_moment_operating_on

  • earliest_available_moment

  • prev_moment_operating_on

  • next_moments_operating_on

  • operation_at

  • all_qubits

  • all_operations

  • findall_operations

  • findall_operations_between

  • findall_operations_until_blocked

  • findall_operations_with_gate_type

  • reachable_frontier_from

  • has_measurements

  • are_all_matches_terminal

  • are_all_measurements_terminal

  • unitary

  • final_state_vector

  • to_text_diagram

  • to_text_diagram_drawer

  • qid_shape

  • all_measurement_key_names

  • to_quil

  • to_qasm

  • save_qasm

  • get_independent_qubit_sets

Methods for mutation:

  • insert

  • append

  • insert_into_range

  • clear_operations_touching

  • batch_insert

  • batch_remove

  • batch_insert_into

  • insert_at_frontier

Circuits can also be iterated over,

for moment in circuit:


and sliced,

  • circuit[1:3] is a new Circuit made up of two moments, the first being

    circuit[1] and the second being circuit[2];

  • circuit[:, qubit] is a new Circuit with the same moments, but with

    only those operations which act on the given Qubit;

  • circuit[:, qubits], where ‘qubits’ is list of Qubits, is a new Circuit

    with the same moments, but only with those operations which touch any of the given qubits;

  • circuit[1:3, qubit] is equivalent to circuit[1:3][:, qubit];

  • circuit[1:3, qubits] is equivalent to circuit[1:3][:, qubits];

and concatenated,

  • circuit1 + circuit2 is a new Circuit made up of the moments in

    circuit1 followed by the moments in circuit2;

and multiplied by an integer,

  • circuit * k is a new Circuit made up of the moments in circuit repeated

    k times.

and mutated, * circuit[1:7] = [Moment(…)]

and factorized, * circuit.factorize() returns a sequence of Circuits which represent

independent ‘factors’ of the original Circuit.


get_devices([filters, refresh])

Displays a list of all supported devices matching given filters, tabulated by provider, name, and qBraid ID.


Refreshes status for all qbraid supported devices.


Apply qbraid quantum program wrapper to a supported quantum program.


Apply qbraid device wrapper to device from a supported device provider.


Retrieve a job from qBraid API using job ID and return job wrapper object.


Displays a list of quantum jobs submitted by user, tabulated by job ID, the date/time it was submitted, and status.



Base class for errors raised by qBraid.


Class for errors raised due to unsupported quantum frontend package


Class for errors raised when processing unsupported quantum programs


Class for errors raised when using visualization features.


For errors raised while processing OpenQASM programs.