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([num_wires, num_gates, gate_types])

Contains attributes which store key resources such as number of gates, number of wires, and gate types.

CompressedResourceOp(op_type, params[, name])

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

ResourceOperator()

Abstract class that defines the methods a PennyLane Operator must implement in order to be used for resource estimation.

Operators

ResourceCCZ(wires[, id])

Resource class for the CCZ gate.

ResourceCH(wires[, id])

Resource class for the CH gate.

ResourceCNOT(wires[, id])

Resource class for the CNOT gate.

ResourceControlledPhaseShift(phi, wires[, id])

Resource class for the ControlledPhaseShift gate.

ResourceCRot(phi, theta, omega, wires[, id])

Resource class for the CRot gate.

ResourceCRX(phi, wires[, id])

Resource class for the CRX gate.

ResourceCRY(phi, wires[, id])

Resource class for the CRY gate.

ResourceCRZ(phi, wires[, id])

Resource class for the CRZ gate.

ResourceCSWAP(wires[, id])

Resource class for the CSWAP gate.

ResourceCY(wires[, id])

Resource class for the CY gate.

ResourceCZ(wires[, id])

Resource class for the CZ gate.

ResourceDoubleExcitation(phi, wires[, id])

Resource class for the DoubleExcitation gate.

ResourceDoubleExcitationMinus(*params[, ...])

Resource class for the DoubleExcitationMinus gate.

ResourceDoubleExcitationPlus(phi, wires[, id])

Resource class for the DoubleExcitationPlus gate.

ResourceFermionicSWAP(phi, wires[, id])

Resource class for the FermionicSWAP gate.

ResourceGlobalPhase(phi[, wires, id])

Resource class for the GlobalPhase gate.

ResourceHadamard(wires[, id])

Resource class for the Hadamard gate.

ResourceIdentity([wires, id])

Resource class for the Identity gate.

ResourceIsingXX(phi, wires[, id])

Resource class for the IsingXX gate.

ResourceIsingXY(phi, wires[, id])

Resource class for the IsingXY gate.

ResourceIsingYY(phi, wires[, id])

Resource class for the IsingYY gate.

ResourceIsingZZ(phi, wires[, id])

Resource class for the IsingZZ gate.

ResourceMultiControlledX([wires, ...])

Resource class for the MultiControlledX gate.

ResourceMultiRZ(theta, wires[, id])

Resource class for the MultiRZ gate.

ResourceOrbitalRotation(phi, wires[, id])

Resource class for the OrbitalRotation gate.

ResourcePauliRot(theta, pauli_word, wires[, id])

Resource class for the PauliRot gate.

ResourcePhaseShift(phi, wires[, id])

Resource class for the PhaseShift gate.

ResourcePSWAP(phi, wires[, id])

Resource class for the PSWAP gate.

ResourceRot(phi, theta, omega, wires[, id])

Resource class for the Rot-gate.

ResourceRX(phi, wires[, id])

Resource class for the RX gate.

ResourceRY(phi, wires[, id])

Resource class for the RY gate.

ResourceRZ(phi, wires[, id])

Resource class for the RZ gate.

ResourceS(*params[, wires, id])

Resource class for the S-gate.

ResourceSingleExcitation(phi, wires[, id])

Resource class for the SingleExcitation gate.

ResourceSingleExcitationMinus(phi, wires[, id])

Resource class for the SingleExcitationMinus gate.

ResourceSingleExcitationPlus(phi, wires[, id])

Resource class for the SingleExcitationPlus gate.

ResourceSWAP(*params[, wires, id])

Resource class for the SWAP gate.

ResourceT(*params[, wires, id])

Resource class for the T-gate.

ResourceToffoli(wires[, id])

Resource class for the Toffoli gate.

ResourceX(wires[, id])

Resource class for the X-gate.

ResourceY(wires[, id])

Resource class for the Y-gate.

ResourceZ(wires[, id])

Resource class for the Z-gate.

Symbolic Operators

ResourceAdjoint([base, id])

Resource class for the symbolic AdjointOperation.

ResourceControlled(base, control_wires[, ...])

Resource class for the symbolic ControlledOp.

ResourceExp(base[, coeff, num_steps, id])

Resource class for the symbolic Exp operation.

ResourcePow([base, z, id])

Resource class for the symbolic Pow operation.

ResourceProd(*operands[, id, _pauli_rep])

Resource class for the symbolic Prod operation.

Templates

ResourceAmplitudeAmplification(U, O[, ...])

Resource class for the AmplitudeAmplification template.

ResourceBasisRotation(wires, unitary_matrix)

Resource class for the BasisRotation gate.

ResourcePrepSelPrep(lcu[, control, id])

Resource class for PrepSelPrep gate.

ResourceQFT(wires[, id])

Resource class for QFT.

ResourceQPE

Resource class for QuantumPhaseEstimation (QPE).

ResourceQuantumPhaseEstimation(unitary[, ...])

Resource class for QuantumPhaseEstimation (QPE).

ResourceQubitization(hamiltonian, control[, id])

Resource class for the Qubitization gate.

ResourceQROM(bitstrings, control_wires, ...)

Resource class for the QROM template.

ResourceReflection(U[, alpha, ...])

Resource class for the Reflection gate.

ResourceSelect(ops, control[, id])

Resource class for the Select gate.

ResourceTrotterProduct(hamiltonian, time[, ...])

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

ResourceTrotterizedQfunc(time, *trainable_args)

Generates higher order Suzuki-Trotter product formulas from a set of operations defined in a function.

resource_trotterize(qfunc[, n, order, reverse])

Generates higher order Suzuki-Trotter product formulas from a set of operations defined in a function.

ResourceControlledSequence(base, control[, id])

Resource class for the ControlledSequence template.

ResourceModExp(x_wires, output_wires, base)

Resource class for the ModExp template.

ResourceMultiplier(k, x_wires[, mod, ...])

Resource class for the Multiplier template.

ResourcePhaseAdder(k, x_wires[, mod, ...])

Resource class for the PhaseAdder template.

State Preparation Templates

ResourceBasisState(state, wires[, id])

Resource class for the BasisState template.

ResourceStatePrep(state, wires[, pad_with, ...])

Resource class for StatePrep.

ResourceSuperposition(coeffs, bases, wires, ...)

Resource class for the Superposition template.

ResourceMottonenStatePreparation(...[, id])

Resource class for the MottonenStatePreparation template.

Tracking Resources

get_resources(obj[, gate_set, config])

Obtain the resources from a quantum circuit or operation in terms of the gates provided in the gate_set.

Resource Object Functions:

add_in_series(first, other[, in_place])

Add two resources assuming the circuits are executed in series.

add_in_parallel(first, other[, in_place])

Add two resources assuming the circuits are executed in parallel.

mul_in_series(first, scalar[, in_place])

Multiply the resources by a scalar assuming the circuits are executed in series.

mul_in_parallel(first, scalar[, in_place])

Multiply the resources by a scalar assuming the circuits are executed in parallel.

substitute(initial_resources, gate_name, ...)

Replaces a specified gate in a Resources object with the contents of another Resources object.