QuantumVolume

class QuantumVolume(num_qubits, depth=None, seed=None, classical_permutation=True)[source]

A quantum volume model circuit.

The model circuits are random instances of circuits used to measure the Quantum Volume metric, as introduced in [1].

The model circuits consist of layers of Haar random elements of SU(4) applied between corresponding pairs of qubits in a random bipartition.

Reference Circuit:

../_images/qiskit.circuit.library.QuantumVolume_0_0.png

Expanded Circuit:

../_images/qiskit.circuit.library.QuantumVolume_1_0.png

References:

[1] A. Cross et al. Validating quantum computers using randomized model circuits, Phys. Rev. A 100, 032328 (2019). [arXiv:1811.12926]

Create quantum volume model circuit of size num_qubits x depth.

Parameters
  • num_qubits (int) – number of active qubits in model circuit.

  • depth (Optional[int]) – layers of SU(4) operations in model circuit.

  • seed (Optional[int]) – randomization seed.

  • classical_permutation (bool) – use classical permutations at every layer, rather than quantum.

Attributes

QuantumVolume.clbits

Returns a list of classical bits in the order that the registers were added.

QuantumVolume.data

Return the circuit data (instructions and context).

QuantumVolume.extension_lib

QuantumVolume.header

QuantumVolume.instances

QuantumVolume.n_qubits

Deprecated, use num_qubits instead.

QuantumVolume.num_clbits

Return number of classical bits.

QuantumVolume.num_parameters

Convenience function to get the number of parameter objects in the circuit.

QuantumVolume.num_qubits

Return number of qubits.

QuantumVolume.parameters

Convenience function to get the parameters defined in the parameter table.

QuantumVolume.prefix

QuantumVolume.qubits

Returns a list of quantum bits in the order that the registers were added.

Methods

QuantumVolume.AND(qr_variables, qb_target, …)

Build a collective conjunction (AND) circuit in place using mct.

QuantumVolume.OR(qr_variables, qb_target, …)

Build a collective disjunction (OR) circuit in place using mct.

QuantumVolume.__getitem__(item)

Return indexed operation.

QuantumVolume.__len__()

Return number of operations in circuit.

QuantumVolume.add_register(*regs)

Add registers.

QuantumVolume.append(instruction[, qargs, cargs])

Append one or more instructions to the end of the circuit, modifying the circuit in place.

QuantumVolume.assign_parameters(param_dict)

Assign parameters to new parameters or values.

QuantumVolume.barrier(*qargs)

Apply Barrier.

QuantumVolume.bind_parameters(value_dict)

Assign numeric parameters to values yielding a new circuit.

QuantumVolume.cast(value, _type)

Best effort to cast value to type.

QuantumVolume.cbit_argument_conversion(…)

Converts several classical bit representations (such as indexes, range, etc.) into a list of classical bits.

QuantumVolume.ccx(control_qubit1, …[, …])

Apply CCXGate.

QuantumVolume.ch(control_qubit, target_qubit, *)

Apply CHGate.

QuantumVolume.cls_instances()

Return the current number of instances of this class, useful for auto naming.

QuantumVolume.cls_prefix()

Return the prefix to use for auto naming.

QuantumVolume.cnot(control_qubit, …[, …])

Apply CXGate.

QuantumVolume.combine(rhs)

Append rhs to self if self contains compatible registers.

QuantumVolume.compose(other[, qubits, …])

Compose circuit with other circuit or instruction, optionally permuting wires.

QuantumVolume.copy([name])

Copy the circuit.

QuantumVolume.count_ops()

Count each operation kind in the circuit.

QuantumVolume.crx(theta, control_qubit, …)

Apply CRXGate.

QuantumVolume.cry(theta, control_qubit, …)

Apply CRYGate.

QuantumVolume.crz(theta, control_qubit, …)

Apply CRZGate.

QuantumVolume.cswap(control_qubit, …[, …])

Apply CSwapGate.

QuantumVolume.cu1(theta, control_qubit, …)

Apply CU1Gate.

QuantumVolume.cu3(theta, phi, lam, …[, …])

Apply CU3Gate.

QuantumVolume.cx(control_qubit, target_qubit, *)

Apply CXGate.

QuantumVolume.cy(control_qubit, target_qubit, *)

Apply CYGate.

QuantumVolume.cz(control_qubit, target_qubit, *)

Apply CZGate.

QuantumVolume.dcx(qubit1, qubit2)

Apply DCXGate.

QuantumVolume.decompose()

Call a decomposition pass on this circuit, to decompose one level (shallow decompose).

QuantumVolume.depth()

Return circuit depth (i.e., length of critical path).

QuantumVolume.diag_gate(diag, qubit)

Deprecated version of QuantumCircuit.diagonal.

QuantumVolume.diagonal(diag, qubit)

Attach a diagonal gate to a circuit.

QuantumVolume.draw([output, scale, …])

Draw the quantum circuit.

QuantumVolume.extend(rhs)

Append QuantumCircuit to the right hand side if it contains compatible registers.

QuantumVolume.fredkin(control_qubit, …[, …])

Apply CSwapGate.

QuantumVolume.from_qasm_file(path)

Take in a QASM file and generate a QuantumCircuit object.

QuantumVolume.from_qasm_str(qasm_str)

Take in a QASM string and generate a QuantumCircuit object.

QuantumVolume.h(qubit, *[, q])

Apply HGate.

QuantumVolume.hamiltonian(operator, time, qubits)

Apply hamiltonian evolution to to qubits.

QuantumVolume.has_register(register)

Test if this circuit has the register r.

QuantumVolume.i(qubit, *[, q])

Apply IGate.

QuantumVolume.id(qubit, *[, q])

Apply IGate.

QuantumVolume.iden(qubit, *[, q])

Deprecated identity gate.

QuantumVolume.initialize(params, qubits)

Apply initialize to circuit.

QuantumVolume.inverse()

Invert this circuit.

QuantumVolume.iso(isometry, q_input, …[, …])

Attach an arbitrary isometry from m to n qubits to a circuit.

QuantumVolume.isometry(isometry, q_input, …)

Attach an arbitrary isometry from m to n qubits to a circuit.

QuantumVolume.iswap(qubit1, qubit2)

Apply iSwapGate.

QuantumVolume.mcmt(gate, control_qubits, …)

Apply a multi-control, multi-target using a generic gate.

QuantumVolume.mcrx(theta, q_controls, q_target)

Apply Multiple-Controlled X rotation gate

QuantumVolume.mcry(theta, q_controls, …[, …])

Apply Multiple-Controlled Y rotation gate

QuantumVolume.mcrz(lam, q_controls, q_target)

Apply Multiple-Controlled Z rotation gate

QuantumVolume.mct(control_qubits, target_qubit)

Apply MCXGate.

QuantumVolume.mcu1(lam, control_qubits, …)

Apply MCU1Gate.

QuantumVolume.mcx(control_qubits, target_qubit)

Apply MCXGate.

QuantumVolume.measure(qubit, cbit)

Measure quantum bit into classical bit (tuples).

QuantumVolume.measure_active([inplace])

Adds measurement to all non-idle qubits.

QuantumVolume.measure_all([inplace])

Adds measurement to all qubits.

QuantumVolume.mirror()

Mirror the circuit by reversing the instructions.

QuantumVolume.ms(theta, qubits)

Apply MSGate.

QuantumVolume.num_connected_components([…])

How many non-entangled subcircuits can the circuit be factored to.

QuantumVolume.num_nonlocal_gates()

Return number of non-local gates (i.e.

QuantumVolume.num_tensor_factors()

Computes the number of tensor factors in the unitary (quantum) part of the circuit only.

QuantumVolume.num_unitary_factors()

Computes the number of tensor factors in the unitary (quantum) part of the circuit only.

QuantumVolume.qasm([formatted, filename])

Return OpenQASM string.

QuantumVolume.qbit_argument_conversion(…)

Converts several qubit representations (such as indexes, range, etc.) into a list of qubits.

QuantumVolume.r(theta, phi, qubit, *[, q])

Apply RGate.

QuantumVolume.rcccx(control_qubit1, …)

Apply RC3XGate.

QuantumVolume.rccx(control_qubit1, …)

Apply RCCXGate.

QuantumVolume.remove_final_measurements([…])

Removes final measurement on all qubits if they are present.

QuantumVolume.reset(qubit)

Reset q.

QuantumVolume.rx(theta, qubit, *[, label, q])

Apply RXGate.

QuantumVolume.rxx(theta, qubit1, qubit2)

Apply RXXGate.

QuantumVolume.ry(theta, qubit, *[, label, q])

Apply RYGate.

QuantumVolume.ryy(theta, qubit1, qubit2)

Apply RYYGate.

QuantumVolume.rz(phi, qubit, *[, q])

Apply RZGate.

QuantumVolume.rzx(theta, qubit1, qubit2)

Apply RZXGate.

QuantumVolume.rzz(theta, qubit1, qubit2)

Apply RZZGate.

QuantumVolume.s(qubit, *[, q])

Apply SGate.

QuantumVolume.sdg(qubit, *[, q])

Apply SdgGate.

QuantumVolume.size()

Returns total number of gate operations in circuit.

QuantumVolume.snapshot(label[, …])

Take a statevector snapshot of the internal simulator representation.

QuantumVolume.snapshot_density_matrix(label)

Take a density matrix snapshot of simulator state.

QuantumVolume.snapshot_expectation_value(…)

Take a snapshot of expectation value <O> of an Operator.

QuantumVolume.snapshot_probabilities(label, …)

Take a probability snapshot of the simulator state.

QuantumVolume.snapshot_stabilizer(label)

Take a stabilizer snapshot of the simulator state.

QuantumVolume.snapshot_statevector(label)

Take a statevector snapshot of the simulator state.

QuantumVolume.squ(unitary_matrix, qubit[, …])

Decompose an arbitrary 2*2 unitary into three rotation gates.

QuantumVolume.swap(qubit1, qubit2)

Apply SwapGate.

QuantumVolume.t(qubit, *[, q])

Apply TGate.

QuantumVolume.tdg(qubit, *[, q])

Apply TdgGate.

QuantumVolume.to_gate([parameter_map])

Create a Gate out of this circuit.

QuantumVolume.to_instruction([parameter_map])

Create an Instruction out of this circuit.

QuantumVolume.toffoli(control_qubit1, …[, …])

Apply CCXGate.

QuantumVolume.u1(theta, qubit, *[, q])

Apply U1Gate.

QuantumVolume.u2(phi, lam, qubit, *[, q])

Apply U2Gate.

QuantumVolume.u3(theta, phi, lam, qubit, *)

Apply U3Gate.

QuantumVolume.uc(gate_list, q_controls, q_target)

Attach a uniformly controlled gates (also called multiplexed gates) to a circuit.

QuantumVolume.ucg(angle_list, q_controls, …)

Deprecated version of uc.

QuantumVolume.ucrx(angle_list, q_controls, …)

Attach a uniformly controlled (also called multiplexed) Rx rotation gate to a circuit.

QuantumVolume.ucry(angle_list, q_controls, …)

Attach a uniformly controlled (also called multiplexed) Ry rotation gate to a circuit.

QuantumVolume.ucrz(angle_list, q_controls, …)

Attach a uniformly controlled (also called multiplexed gates) Rz rotation gate to a circuit.

QuantumVolume.ucx(angle_list, q_controls, …)

Deprecated version of ucrx.

QuantumVolume.ucy(angle_list, q_controls, …)

Deprecated version of ucry.

QuantumVolume.ucz(angle_list, q_controls, …)

Deprecated version of ucrz.

QuantumVolume.unitary(obj, qubits[, label])

Apply unitary gate to q.

QuantumVolume.width()

Return number of qubits plus clbits in circuit.

QuantumVolume.x(qubit, *[, label, ctrl_state, q])

Apply XGate.

QuantumVolume.y(qubit, *[, q])

Apply YGate.

QuantumVolume.z(qubit, *[, q])

Apply ZGate.

QuantumVolume.__len__()

Return number of operations in circuit.

QuantumVolume.__getitem__(item)

Return indexed operation.