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:

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 (Union[int, Generator, None]) – Random number generator or generator seed.

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

Attributes

QuantumVolume.ancillas

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

QuantumVolume.calibrations

Return calibration dictionary.

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.global_phase

Return the global phase of the circuit in radians.

QuantumVolume.header

QuantumVolume.instances

QuantumVolume.num_ancillas

Return the number of ancilla qubits.

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.__getitem__(item)

Return indexed operation.

QuantumVolume.__len__()

Return number of operations in circuit.

QuantumVolume.add_calibration(gate, qubits, …)

Register a low-level, custom pulse definition for the given gate.

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, target_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.control([num_ctrl_qubits, …])

Control this circuit on num_ctrl_qubits qubits.

QuantumVolume.copy([name])

Copy the circuit.

QuantumVolume.count_ops()

Count each operation kind in the circuit.

QuantumVolume.cp(theta, control_qubit, …)

Apply CPhaseGate.

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.csx(control_qubit, target_qubit)

Apply CSXGate.

QuantumVolume.cu(theta, phi, lam, gamma, …)

Apply CUGate.

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.delay(duration[, qarg, unit])

Apply Delay.

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)

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)

Apply IGate.

QuantumVolume.id(qubit)

Apply IGate.

QuantumVolume.initialize(params, qubits)

Apply initialize to circuit.

QuantumVolume.inverse()

Invert (take adjoint of) 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.mcp(lam, control_qubits, …)

Apply MCPhaseGate.

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()

DEPRECATED: use circuit.reverse_ops().

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.p(theta, qubit)

Apply PhaseGate.

QuantumVolume.power(power[, matrix_power])

Raise this circuit to the power of power.

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.qubit_duration(*qubits)

Return the duration between the start and stop time of the first and last instructions, excluding delays, over the supplied qubits.

QuantumVolume.qubit_start_time(*qubits)

Return the start time of the first instruction, excluding delays, over the supplied qubits.

QuantumVolume.qubit_stop_time(*qubits)

Return the stop time of the last instruction, excluding delays, over the supplied qubits.

QuantumVolume.r(theta, phi, qubit)

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.repeat(reps)

Repeat this circuit reps times.

QuantumVolume.reset(qubit)

Reset q.

QuantumVolume.reverse_bits()

Return a circuit with the opposite order of wires.

QuantumVolume.reverse_ops()

Reverse the circuit by reversing the order of instructions.

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

Apply RXGate.

QuantumVolume.rxx(theta, qubit1, qubit2)

Apply RXXGate.

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

Apply RYGate.

QuantumVolume.ryy(theta, qubit1, qubit2)

Apply RYYGate.

QuantumVolume.rz(phi, qubit)

Apply RZGate.

QuantumVolume.rzx(theta, qubit1, qubit2)

Apply RZXGate.

QuantumVolume.rzz(theta, qubit1, qubit2)

Apply RZZGate.

QuantumVolume.s(qubit)

Apply SGate.

QuantumVolume.sdg(qubit)

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.sx(qubit)

Apply SXGate.

QuantumVolume.sxdg(qubit)

Apply SXdgGate.

QuantumVolume.t(qubit)

Apply TGate.

QuantumVolume.tdg(qubit)

Apply TdgGate.

QuantumVolume.to_gate([parameter_map, label])

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.u(theta, phi, lam, qubit)

Apply UGate.

QuantumVolume.u1(theta, qubit)

Apply U1Gate.

QuantumVolume.u2(phi, lam, qubit)

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.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.unitary(obj, qubits[, label])

Apply unitary gate to q.

QuantumVolume.width()

Return number of qubits plus clbits in circuit.

QuantumVolume.x(qubit[, label])

Apply XGate.

QuantumVolume.y(qubit)

Apply YGate.

QuantumVolume.z(qubit)

Apply ZGate.

QuantumVolume.__getitem__(item)

Return indexed operation.

QuantumVolume.__len__()

Return number of operations in circuit.