MCMTVChain

class MCMTVChain(gate, num_ctrl_qubits, num_target_qubits)[source]

The MCMT implementation using the CCX V-chain.

Create a new multi-control multi-target gate.

Parameters
  • gate (Union[Gate, Callable[[QuantumCircuit, Qubit, Qubit], Instruction]]) – The gate to be applied controlled on the control qubits and applied to the target qubits. Can be either a Gate or a circuit method. If it is a callable, it will be casted to a Gate.

  • num_ctrl_qubits (int) – The number of control qubits.

  • num_target_qubits (int) – The number of target qubits.

Raises
  • AttributeError – If the gate cannot be casted to a controlled gate.

  • AttributeError – If the number of controls or targets is 0.

Attributes

MCMTVChain.clbits

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

MCMTVChain.data

Return the circuit data (instructions and context).

MCMTVChain.extension_lib

MCMTVChain.header

MCMTVChain.instances

MCMTVChain.n_qubits

Deprecated, use num_qubits instead.

MCMTVChain.num_ancilla_qubits

Return the number of ancilla qubits required.

MCMTVChain.num_clbits

Return number of classical bits.

MCMTVChain.num_parameters

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

MCMTVChain.num_qubits

Return number of qubits.

MCMTVChain.parameters

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

MCMTVChain.prefix

MCMTVChain.qubits

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

Methods

MCMTVChain.AND(qr_variables, qb_target, …)

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

MCMTVChain.OR(qr_variables, qb_target, …)

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

MCMTVChain.__getitem__(item)

Return indexed operation.

MCMTVChain.__len__()

Return number of operations in circuit.

MCMTVChain.add_register(*regs)

Add registers.

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

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

MCMTVChain.assign_parameters(param_dict[, …])

Assign parameters to new parameters or values.

MCMTVChain.barrier(*qargs)

Apply Barrier.

MCMTVChain.bind_parameters(value_dict)

Assign numeric parameters to values yielding a new circuit.

MCMTVChain.cast(value, _type)

Best effort to cast value to type.

MCMTVChain.cbit_argument_conversion(…)

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

MCMTVChain.ccx(control_qubit1, …[, ctl1, …])

Apply CCXGate.

MCMTVChain.ch(control_qubit, target_qubit, *)

Apply CHGate.

MCMTVChain.cls_instances()

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

MCMTVChain.cls_prefix()

Return the prefix to use for auto naming.

MCMTVChain.cnot(control_qubit, target_qubit, *)

Apply CXGate.

MCMTVChain.combine(rhs)

Append rhs to self if self contains compatible registers.

MCMTVChain.compose(other[, qubits, clbits, …])

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

MCMTVChain.control([num_ctrl_qubits])

Return the controlled version of the MCMT circuit.

MCMTVChain.copy([name])

Copy the circuit.

MCMTVChain.count_ops()

Count each operation kind in the circuit.

MCMTVChain.crx(theta, control_qubit, …[, …])

Apply CRXGate.

MCMTVChain.cry(theta, control_qubit, …[, …])

Apply CRYGate.

MCMTVChain.crz(theta, control_qubit, …[, …])

Apply CRZGate.

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

Apply CSwapGate.

MCMTVChain.cu1(theta, control_qubit, …[, …])

Apply CU1Gate.

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

Apply CU3Gate.

MCMTVChain.cx(control_qubit, target_qubit, *)

Apply CXGate.

MCMTVChain.cy(control_qubit, target_qubit, *)

Apply CYGate.

MCMTVChain.cz(control_qubit, target_qubit, *)

Apply CZGate.

MCMTVChain.dcx(qubit1, qubit2)

Apply DCXGate.

MCMTVChain.decompose()

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

MCMTVChain.depth()

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

MCMTVChain.diag_gate(diag, qubit)

Deprecated version of QuantumCircuit.diagonal.

MCMTVChain.diagonal(diag, qubit)

Attach a diagonal gate to a circuit.

MCMTVChain.draw([output, scale, filename, …])

Draw the quantum circuit.

MCMTVChain.extend(rhs)

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

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

Apply CSwapGate.

MCMTVChain.from_qasm_file(path)

Take in a QASM file and generate a QuantumCircuit object.

MCMTVChain.from_qasm_str(qasm_str)

Take in a QASM string and generate a QuantumCircuit object.

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

Apply HGate.

MCMTVChain.hamiltonian(operator, time, qubits)

Apply hamiltonian evolution to to qubits.

MCMTVChain.has_register(register)

Test if this circuit has the register r.

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

Apply IGate.

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

Apply IGate.

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

Deprecated identity gate.

MCMTVChain.initialize(params, qubits)

Apply initialize to circuit.

MCMTVChain.inverse()

Return the inverse MCMT circuit, which is itself.

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

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

MCMTVChain.isometry(isometry, q_input, …)

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

MCMTVChain.iswap(qubit1, qubit2)

Apply iSwapGate.

MCMTVChain.mcmt(gate, control_qubits, …[, …])

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

MCMTVChain.mcrx(theta, q_controls, q_target)

Apply Multiple-Controlled X rotation gate

MCMTVChain.mcry(theta, q_controls, q_target, …)

Apply Multiple-Controlled Y rotation gate

MCMTVChain.mcrz(lam, q_controls, q_target[, …])

Apply Multiple-Controlled Z rotation gate

MCMTVChain.mct(control_qubits, target_qubit)

Apply MCXGate.

MCMTVChain.mcu1(lam, control_qubits, …)

Apply MCU1Gate.

MCMTVChain.mcx(control_qubits, target_qubit)

Apply MCXGate.

MCMTVChain.measure(qubit, cbit)

Measure quantum bit into classical bit (tuples).

MCMTVChain.measure_active([inplace])

Adds measurement to all non-idle qubits.

MCMTVChain.measure_all([inplace])

Adds measurement to all qubits.

MCMTVChain.mirror()

Mirror the circuit by reversing the instructions.

MCMTVChain.ms(theta, qubits)

Apply MSGate.

MCMTVChain.num_connected_components([…])

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

MCMTVChain.num_nonlocal_gates()

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

MCMTVChain.num_tensor_factors()

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

MCMTVChain.num_unitary_factors()

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

MCMTVChain.qasm([formatted, filename])

Return OpenQASM string.

MCMTVChain.qbit_argument_conversion(…)

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

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

Apply RGate.

MCMTVChain.rcccx(control_qubit1, …)

Apply RC3XGate.

MCMTVChain.rccx(control_qubit1, …)

Apply RCCXGate.

MCMTVChain.remove_final_measurements([inplace])

Removes final measurement on all qubits if they are present.

MCMTVChain.reset(qubit)

Reset q.

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

Apply RXGate.

MCMTVChain.rxx(theta, qubit1, qubit2)

Apply RXXGate.

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

Apply RYGate.

MCMTVChain.ryy(theta, qubit1, qubit2)

Apply RYYGate.

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

Apply RZGate.

MCMTVChain.rzx(theta, qubit1, qubit2)

Apply RZXGate.

MCMTVChain.rzz(theta, qubit1, qubit2)

Apply RZZGate.

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

Apply SGate.

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

Apply SdgGate.

MCMTVChain.size()

Returns total number of gate operations in circuit.

MCMTVChain.snapshot(label[, snapshot_type, …])

Take a statevector snapshot of the internal simulator representation.

MCMTVChain.snapshot_density_matrix(label[, …])

Take a density matrix snapshot of simulator state.

MCMTVChain.snapshot_expectation_value(label, …)

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

MCMTVChain.snapshot_probabilities(label, qubits)

Take a probability snapshot of the simulator state.

MCMTVChain.snapshot_stabilizer(label)

Take a stabilizer snapshot of the simulator state.

MCMTVChain.snapshot_statevector(label)

Take a statevector snapshot of the simulator state.

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

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

MCMTVChain.swap(qubit1, qubit2)

Apply SwapGate.

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

Apply TGate.

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

Apply TdgGate.

MCMTVChain.to_gate([parameter_map])

Create a Gate out of this circuit.

MCMTVChain.to_instruction([parameter_map])

Create an Instruction out of this circuit.

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

Apply CCXGate.

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

Apply U1Gate.

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

Apply U2Gate.

MCMTVChain.u3(theta, phi, lam, qubit, *[, q])

Apply U3Gate.

MCMTVChain.uc(gate_list, q_controls, q_target)

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

MCMTVChain.ucg(angle_list, q_controls, q_target)

Deprecated version of uc.

MCMTVChain.ucrx(angle_list, q_controls, q_target)

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

MCMTVChain.ucry(angle_list, q_controls, q_target)

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

MCMTVChain.ucrz(angle_list, q_controls, q_target)

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

MCMTVChain.ucx(angle_list, q_controls, q_target)

Deprecated version of ucrx.

MCMTVChain.ucy(angle_list, q_controls, q_target)

Deprecated version of ucry.

MCMTVChain.ucz(angle_list, q_controls, q_target)

Deprecated version of ucrz.

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

Apply unitary gate to q.

MCMTVChain.width()

Return number of qubits plus clbits in circuit.

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

Apply XGate.

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

Apply YGate.

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

Apply ZGate.

MCMTVChain.__getitem__(item)

Return indexed operation.

MCMTVChain.__len__()

Return number of operations in circuit.