qml.labs.resource_estimation

This module contains experimental features for resource estimation.

Warning

This module is experimental. Frequent changes will occur, with no guarantees of stability or backwards compatibility.

Resource Estimation Base Classes:

Resources(qubit_manager[, gate_types])

A container to track and update the resources used throughout a quantum circuit.

ResourceOperator(*args[, wires])

Base class to represent quantum operators according to the set of information required for resource estimation.

CompressedResourceOp(op_type[, params, name])

Instantiate a light weight class corresponding to the operator type and parameters.

GateCount(gate[, count])

A class to represent a gate and its number of occurrences in a circuit or decomposition.

Resource Estimation Functions:

estimate_resources(obj[, gate_set, config, ...])

Estimate the quantum resources required from a circuit or operation in terms of the gates provided in the gateset.

resource_rep(resource_op[, resource_params])

Produce a compressed representation of the resource operator to be used when tracking resources.

set_decomp(cls, decomp_func)

Set a custom function to override the default resource decomposition.

set_adj_decomp(cls, decomp_func)

Set a custom function to override the default adjoint-resource decomposition.

set_ctrl_decomp(cls, decomp_func)

Set a custom function to override the default controlled-resource decomposition.

set_pow_decomp(cls, decomp_func)

Set a custom function to override the default pow-resource decomposition.

Qubit Management Classes:

QubitManager(work_wires[, algo_wires, ...])

Manages and tracks the auxiliary and algorithmic qubits used in a quantum circuit.

AllocWires(num_wires)

Allows users to allocate clean work wires.

FreeWires(num_wires)

Allows users to free dirty work wires.

Arithmetic Operators:

ResourceAdjoint(base_op[, wires])

Resource class for the symbolic Adjoint operation.

ResourceChangeBasisOp(compute_op, base_op[, ...])

Change of Basis resource operator.

ResourceControlled(base_op, num_ctrl_wires, ...)

Resource class for the symbolic Controlled operation.

ResourcePow(base_op, z[, wires])

Resource class for the symbolic Pow operation.

ResourceProd(res_ops[, wires])

Resource class for the symbolic Prod operation.

Operators:

ResourceGlobalPhase(*args[, wires])

Resource class for the GlobalPhase gate.

ResourceHadamard(*args[, wires])

Resource class for the Hadamard gate.

ResourceIdentity(*args[, wires])

Resource class for the Identity gate.

ResourceS(*args[, wires])

Resource class for the S-gate.

ResourceT(*args[, wires])

Resource class for the T-gate.

ResourceX(*args[, wires])

Resource class for the X-gate.

ResourceY(*args[, wires])

Resource class for the Y-gate.

ResourceZ(*args[, wires])

Resource class for the Z-gate.

ResourceRX([eps, wires])

Resource class for the RX gate.

ResourceRY([eps, wires])

Resource class for the RY gate.

ResourceRZ([eps, wires])

Resource class for the RZ gate.

ResourceRot([eps, wires])

Resource class for the Rot-gate.

ResourcePhaseShift([epsilon, wires])

Resource class for the PhaseShift gate.

ResourceSWAP(*args[, wires])

Resource class for the SWAP gate.

ResourceCH(*args[, wires])

Resource class for the CH gate.

ResourceCY(*args[, wires])

Resource class for the CY gate.

ResourceCZ(*args[, wires])

Resource class for the CZ gate.

ResourceCSWAP(*args[, wires])

Resource class for the CSWAP gate.

ResourceCCZ(*args[, wires])

Resource class for the CCZ gate.

ResourceCNOT(*args[, wires])

Resource class for the CNOT gate.

ResourceToffoli([elbow, wires])

Resource class for the Toffoli gate.

ResourceMultiControlledX(num_ctrl_wires, ...)

Resource class for the MultiControlledX gate.

ResourceCRX([eps, wires])

Resource class for the CRX gate.

ResourceCRY([eps, wires])

Resource class for the CRY gate.

ResourceCRZ([eps, wires])

Resource class for the CRZ gate.

ResourceCRot([eps, wires])

Resource class for the CRot gate.

ResourceControlledPhaseShift([eps, wires])

Resource class for the ControlledPhaseShift gate.

ResourceTempAND(*args[, wires])

Resource class representing a temporary AND-gate.

ResourceMultiRZ(num_wires[, eps, wires])

Resource class for the MultiRZ gate.

ResourcePauliRot(pauli_string[, eps, wires])

Resource class for the PauliRot gate.

ResourceIsingXX([eps, wires])

Resource class for the IsingXX gate.

ResourceIsingYY([eps, wires])

Resource class for the IsingYY gate.

ResourceIsingXY([eps, wires])

Resource class for the IsingXY gate.

ResourceIsingZZ([eps, wires])

Resource class for the IsingZZ gate.

ResourcePSWAP([eps, wires])

Resource class for the PSWAP gate.

ResourceSingleExcitation([eps, wires])

Resource class for the SingleExcitation gate.

Templates:

ResourceOutOfPlaceSquare(register_size[, wires])

Resource class for the OutofPlaceSquare gate.

ResourcePhaseGradient(num_wires[, wires])

Resource class for the PhaseGradient gate.

ResourceOutMultiplier(a_num_qubits, b_num_qubits)

Resource class for the OutMultiplier gate.

ResourceSemiAdder(max_register_size[, wires])

Resource class for the SemiOutAdder gate.

ResourceBasisRotation(dim_N[, wires])

Resource class for the BasisRotation gate.

ResourceSelect(select_ops[, wires])

Resource class for the Select gate.

ResourceQROM(num_bitstrings, size_bitstring)

Resource class for the QROM template.

ResourceTrotterCDF(compact_ham, num_steps, order)

An operation representing the Suzuki-Trotter product approximation for the complex matrix exponential of compressed double factorized Hamiltonian.

ResourceTrotterTHC(compact_ham, num_steps, order)

An operation representing the Suzuki-Trotter product approximation for the complex matrix exponential of tensor hypercontracted Hamiltonian.

ResourceTrotterVibrational(compact_ham, ...)

An operation representing the Suzuki-Trotter product approximation for the complex matrix exponential of vibrational Hamiltonian.

ResourceTrotterVibronic(compact_ham, ...[, ...])

An operation representing the Suzuki-Trotter product approximation for the complex matrix exponential of real-space vibronic Hamiltonian.

ResourceQubitizeTHC(compact_ham[, ...])

Resource class for Qubitization of THC Hamiltonian.

Compact Hamiltonian Class:

CompactHamiltonian(method_name, **params)

A compact representation for the Hamiltonian of a quantum system.