qml.estimator

This module contains tools dedicated to logical resource estimation.

The estimator module is the centre for quantum resource estimation in PennyLane. Functionality within estimator is intended purely for resource estimation, and is not intended for true program compilation and execution.

See also

The resource module for resource tracking of compiled programs.

Resource Estimation

The estimate() function is the standard entry point for estimating the resources required by a quantum program. Submit a program written with either standard PennyLane operators (Operation) or resource operators (ResourceOperator), and instantly receive the resource estimate in the form of Resources.

estimate(workflow[, gate_set, zeroed_wires, ...])

Estimate the quantum resources required to implement a circuit or operator in terms of a given gateset.

Resources(zeroed_wires[, any_state_wires, ...])

Stores the estimated resource requirements of a quantum circuit.

ResourceConfig()

Sets the values of precisions and custom decompositions when estimating resources for a quantum workflow.

Resource Operators

ResourceOperator(*args[, wires])

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

CompressedResourceOp(op_type, num_wires[, ...])

This class is a minimal representation of a ResourceOperator, containing only the operator type and the necessary parameters to estimate its resources.

GateCount(gate[, count])

Stores a lightweight representation of a gate and its number of occurrences in a decomposition.

Qubit Management

Allocate(num_wires)

Allows allocation of work wires through WireResourceManager.

Deallocate(num_wires)

Allows freeing any_state work wires through WireResourceManager.

WireResourceManager(zeroed[, any_state, ...])

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

Resource Operators

Adjoint(base_op)

Resource class for the symbolic Adjoint operation.

CCZ([wires])

Resource class for the CCZ gate.

CH([wires])

Resource class for the CH gate.

CNOT([wires])

Resource class for the CNOT gate.

CRX([precision, wires])

Resource class for the CRX gate.

CRY([precision, wires])

Resource class for the CRY gate.

CRZ([precision, wires])

Resource class for the CRZ gate.

CRot([precision, wires])

Resource class for the CRot gate.

CSWAP([wires])

Resource class for the CSWAP gate.

CY([wires])

Resource class for the CY gate.

CZ([wires])

Resource class for the CZ gate.

ChangeOpBasis(compute_op, target_op[, ...])

Change of Basis resource operator.

Controlled(base_op, num_ctrl_wires, ...[, wires])

Resource class for the symbolic Controlled operation.

ControlledPhaseShift([precision, wires])

Resource class for the ControlledPhaseShift gate.

GlobalPhase([wires])

Resource class for the GlobalPhase gate.

Hadamard([wires])

Resource class for the Hadamard gate.

Identity([wires])

Resource class for the Identity gate.

MultiControlledX([num_ctrl_wires, ...])

Resource class for the MultiControlledX gate.

MultiRZ([num_wires, precision, wires])

Resource class for the MultiRZ gate.

PauliRot(pauli_string[, precision, wires])

Resource class for the PauliRot gate.

PhaseShift([precision, wires])

Resource class for the PhaseShift gate.

Pow(base_op, pow_z)

Resource class for the symbolic Pow operation.

Prod(res_ops[, wires])

Resource class for the symbolic Prod operation.

QubitUnitary([num_wires, precision, wires])

Resource class for the QubitUnitary template.

RX([precision, wires])

Resource class for the RX gate.

RY([precision, wires])

Resource class for the RY gate.

RZ([precision, wires])

Resource class for the RZ gate.

Rot([precision, wires])

Resource class for the Rot gate.

S([wires])

Resource class for the S-gate.

SWAP([wires])

Resource class for the SWAP gate.

SingleExcitation([precision, wires])

Resource class for the SingleExcitation gate.

T([wires])

Resource class for the T-gate.

TemporaryAND([wires])

Resource class representing a TemporaryAND gate.

Toffoli([elbow, wires])

Resource class for the Toffoli gate.

X([wires])

Resource class for the X-gate.

Y([wires])

Resource class for the Y-gate.

Z([wires])

Resource class for the Z-gate.

Resource Templates

AQFT(order[, num_wires, wires])

Resource class for the Approximate QFT.

AliasSampling(num_coeffs[, precision, wires])

Resource class for preparing a state using coherent alias sampling.

BasisRotation([dim, wires])

Resource class for the BasisRotation gate.

ControlledSequence(base, num_control_wires)

Resource class for the ControlledSequence gate.

IntegerComparator(value[, register_size, ...])

This operation applies a controlled X gate using integer comparison as the condition.

IterativeQPE(base, num_iter)

Resource class for Iterative Quantum Phase Estimation (IQPE).

MPSPrep(num_mps_matrices, max_bond_dim[, ...])

Resource class for the MPSPrep template.

OutMultiplier(a_num_wires, b_num_wires[, wires])

Resource class for the OutMultiplier gate.

OutOfPlaceSquare(register_size[, wires])

Resource class for the OutofPlaceSquare gate.

PhaseGradient([num_wires, wires])

Resource class for the PhaseGradient gate.

PrepTHC(thc_ham[, coeff_precision, ...])

Resource class for preparing the state for tensor hypercontracted (THC) Hamiltonian.

QFT([num_wires, wires])

Resource class for QFT.

QPE(base, num_estimation_wires[, ...])

Resource class for QuantumPhaseEstimation (QPE).

QROM(num_bitstrings, size_bitstring[, ...])

Resource class for the QROM template.

QROMStatePreparation(num_state_qubits[, ...])

Resource class for the QROMStatePreparation template.

QubitizeTHC(thc_ham[, prep_op, select_op, ...])

Resource class for qubitization of tensor hypercontracted Hamiltonian.

RegisterComparator(first_register, ...[, ...])

This operation applies a controlled X gate using register comparison as the condition.

Select(ops[, wires])

Resource class for the Select gate.

SelectPauliRot(rot_axis, num_ctrl_wires[, ...])

Resource class for the SelectPauliRot gate.

SelectTHC(thc_ham[, rotation_precision, ...])

Resource class for creating the custom Select operator for tensor hypercontracted (THC) Hamiltonian.

SemiAdder(max_register_size[, wires])

Resource class for the SemiAdder gate.

SingleQubitComparator([wires])

Resource class for comparing the values encoded in two input qubits.

TrotterCDF(cdf_ham, num_steps, order[, wires])

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

TrotterProduct(first_order_expansion, ...[, ...])

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

TrotterTHC(thc_ham, num_steps, order[, wires])

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

TrotterVibrational(vibration_ham, num_steps, ...)

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

TrotterVibronic(vibronic_ham, num_steps, order)

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

TwoQubitComparator([wires])

Resource class for comparing the integer values encoded in two quantum registers of two qubits each.

UniformStatePrep(num_states[, wires])

Resource class for preparing a uniform superposition.

Resource Hamiltonians

CDFHamiltonian(num_orbitals, num_fragments)

For a compressed double-factorized (CDF) Hamiltonian, stores the minimum necessary information pertaining to resource estimation.

THCHamiltonian(num_orbitals, tensor_rank)

For a tensor hypercontracted (THC) Hamiltonian, stores the minimum necessary information pertaining to resource estimation.

VibrationalHamiltonian(num_modes, grid_size, ...)

For a vibrational Hamiltonian, stores the minimum necessary information pertaining to resource estimation.

VibronicHamiltonian(num_modes, num_states, ...)

For a vibronic Hamiltonian, stores the minimum necessary information pertaining to resource estimation.

Contents

Using PennyLane

Release news

Development

API

Internals