IQP

class IQP(interactions)[source]

Instantaneous quantum polynomial (IQP) circuit.

The circuit consists of a column of Hadamard gates, a column of powers of T gates, a sequence of powers of CS gates (up to \(\frac{n^2-n}{2}\) of them), and a final column of Hadamard gates, as introduced in [1].

The circuit is parameterized by an n x n interactions matrix. The powers of each T gate are given by the diagonal elements of the interactions matrix. The powers of the CS gates are given by the upper triangle of the interactions matrix.

Reference Circuit:

../_images/qiskit.circuit.library.IQP_0_0.png

Expanded Circuit:

../_images/qiskit.circuit.library.IQP_1_0.png

References:

[1] M. J. Bremner et al. Average-case complexity versus approximate simulation of commuting quantum computations, Phys. Rev. Lett. 117, 080501 (2016). arXiv:1504.07999

Create IQP circuit.

Parameters

interactions (Union[List, array]) – input n-by-n symmetric matrix.

Raises

CircuitError – if the inputs is not as symmetric matrix.

Attributes

IQP.clbits

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

IQP.data

Return the circuit data (instructions and context).

IQP.extension_lib

IQP.header

IQP.instances

IQP.n_qubits

Deprecated, use num_qubits instead.

IQP.num_clbits

Return number of classical bits.

IQP.num_parameters

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

IQP.num_qubits

Return number of qubits.

IQP.parameters

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

IQP.prefix

IQP.qubits

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

Methods

IQP.AND(qr_variables, qb_target, qr_ancillae)

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

IQP.OR(qr_variables, qb_target, qr_ancillae)

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

IQP.__getitem__(item)

Return indexed operation.

IQP.__len__()

Return number of operations in circuit.

IQP.add_register(*regs)

Add registers.

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

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

IQP.assign_parameters(param_dict[, inplace])

Assign parameters to new parameters or values.

IQP.barrier(*qargs)

Apply Barrier.

IQP.bind_parameters(value_dict)

Assign numeric parameters to values yielding a new circuit.

IQP.cast(value, _type)

Best effort to cast value to type.

IQP.cbit_argument_conversion(…)

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

IQP.ccx(control_qubit1, control_qubit2, …)

Apply CCXGate.

IQP.ch(control_qubit, target_qubit, *[, …])

Apply CHGate.

IQP.cls_instances()

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

IQP.cls_prefix()

Return the prefix to use for auto naming.

IQP.cnot(control_qubit, target_qubit, *[, …])

Apply CXGate.

IQP.combine(rhs)

Append rhs to self if self contains compatible registers.

IQP.compose(other[, qubits, clbits, front, …])

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

IQP.copy([name])

Copy the circuit.

IQP.count_ops()

Count each operation kind in the circuit.

IQP.crx(theta, control_qubit, target_qubit, *)

Apply CRXGate.

IQP.cry(theta, control_qubit, target_qubit, *)

Apply CRYGate.

IQP.crz(theta, control_qubit, target_qubit, *)

Apply CRZGate.

IQP.cswap(control_qubit, target_qubit1, …)

Apply CSwapGate.

IQP.cu1(theta, control_qubit, target_qubit, *)

Apply CU1Gate.

IQP.cu3(theta, phi, lam, control_qubit, …)

Apply CU3Gate.

IQP.cx(control_qubit, target_qubit, *[, …])

Apply CXGate.

IQP.cy(control_qubit, target_qubit, *[, …])

Apply CYGate.

IQP.cz(control_qubit, target_qubit, *[, …])

Apply CZGate.

IQP.dcx(qubit1, qubit2)

Apply DCXGate.

IQP.decompose()

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

IQP.depth()

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

IQP.diag_gate(diag, qubit)

Deprecated version of QuantumCircuit.diagonal.

IQP.diagonal(diag, qubit)

Attach a diagonal gate to a circuit.

IQP.draw([output, scale, filename, style, …])

Draw the quantum circuit.

IQP.extend(rhs)

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

IQP.fredkin(control_qubit, target_qubit1, …)

Apply CSwapGate.

IQP.from_qasm_file(path)

Take in a QASM file and generate a QuantumCircuit object.

IQP.from_qasm_str(qasm_str)

Take in a QASM string and generate a QuantumCircuit object.

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

Apply HGate.

IQP.hamiltonian(operator, time, qubits[, label])

Apply hamiltonian evolution to to qubits.

IQP.has_register(register)

Test if this circuit has the register r.

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

Apply IGate.

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

Apply IGate.

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

Deprecated identity gate.

IQP.initialize(params, qubits)

Apply initialize to circuit.

IQP.inverse()

Invert this circuit.

IQP.iso(isometry, q_input, q_ancillas_for_output)

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

IQP.isometry(isometry, q_input, …[, …])

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

IQP.iswap(qubit1, qubit2)

Apply iSwapGate.

IQP.mcmt(gate, control_qubits, target_qubits)

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

IQP.mcrx(theta, q_controls, q_target[, …])

Apply Multiple-Controlled X rotation gate

IQP.mcry(theta, q_controls, q_target, q_ancillae)

Apply Multiple-Controlled Y rotation gate

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

Apply Multiple-Controlled Z rotation gate

IQP.mct(control_qubits, target_qubit[, …])

Apply MCXGate.

IQP.mcu1(lam, control_qubits, target_qubit)

Apply MCU1Gate.

IQP.mcx(control_qubits, target_qubit[, …])

Apply MCXGate.

IQP.measure(qubit, cbit)

Measure quantum bit into classical bit (tuples).

IQP.measure_active([inplace])

Adds measurement to all non-idle qubits.

IQP.measure_all([inplace])

Adds measurement to all qubits.

IQP.mirror()

Mirror the circuit by reversing the instructions.

IQP.ms(theta, qubits)

Apply MSGate.

IQP.num_connected_components([unitary_only])

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

IQP.num_nonlocal_gates()

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

IQP.num_tensor_factors()

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

IQP.num_unitary_factors()

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

IQP.qasm([formatted, filename])

Return OpenQASM string.

IQP.qbit_argument_conversion(…)

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

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

Apply RGate.

IQP.rcccx(control_qubit1, control_qubit2, …)

Apply RC3XGate.

IQP.rccx(control_qubit1, control_qubit2, …)

Apply RCCXGate.

IQP.remove_final_measurements([inplace])

Removes final measurement on all qubits if they are present.

IQP.reset(qubit)

Reset q.

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

Apply RXGate.

IQP.rxx(theta, qubit1, qubit2)

Apply RXXGate.

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

Apply RYGate.

IQP.ryy(theta, qubit1, qubit2)

Apply RYYGate.

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

Apply RZGate.

IQP.rzx(theta, qubit1, qubit2)

Apply RZXGate.

IQP.rzz(theta, qubit1, qubit2)

Apply RZZGate.

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

Apply SGate.

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

Apply SdgGate.

IQP.size()

Returns total number of gate operations in circuit.

IQP.snapshot(label[, snapshot_type, qubits, …])

Take a statevector snapshot of the internal simulator representation.

IQP.snapshot_density_matrix(label[, qubits])

Take a density matrix snapshot of simulator state.

IQP.snapshot_expectation_value(label, op, qubits)

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

IQP.snapshot_probabilities(label, qubits[, …])

Take a probability snapshot of the simulator state.

IQP.snapshot_stabilizer(label)

Take a stabilizer snapshot of the simulator state.

IQP.snapshot_statevector(label)

Take a statevector snapshot of the simulator state.

IQP.squ(unitary_matrix, qubit[, mode, …])

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

IQP.swap(qubit1, qubit2)

Apply SwapGate.

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

Apply TGate.

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

Apply TdgGate.

IQP.to_gate([parameter_map])

Create a Gate out of this circuit.

IQP.to_instruction([parameter_map])

Create an Instruction out of this circuit.

IQP.toffoli(control_qubit1, control_qubit2, …)

Apply CCXGate.

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

Apply U1Gate.

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

Apply U2Gate.

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

Apply U3Gate.

IQP.uc(gate_list, q_controls, q_target[, …])

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

IQP.ucg(angle_list, q_controls, q_target[, …])

Deprecated version of uc.

IQP.ucrx(angle_list, q_controls, q_target)

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

IQP.ucry(angle_list, q_controls, q_target)

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

IQP.ucrz(angle_list, q_controls, q_target)

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

IQP.ucx(angle_list, q_controls, q_target)

Deprecated version of ucrx.

IQP.ucy(angle_list, q_controls, q_target)

Deprecated version of ucry.

IQP.ucz(angle_list, q_controls, q_target)

Deprecated version of ucrz.

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

Apply unitary gate to q.

IQP.width()

Return number of qubits plus clbits in circuit.

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

Apply XGate.

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

Apply YGate.

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

Apply ZGate.

IQP.__getitem__(item)

Return indexed operation.

IQP.__len__()

Return number of operations in circuit.