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.

For a quick introduction to estimator, take a look at our demo on How to use PennyLane for Resource Estimation!

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.

PCPhase(num_wires, dim[, ...])

A resource operator representing a projector-controlled phase gate.

PauliRot(pauli_string[, precision, wires])

Resource class for an arbitrary Pauli word rotation operation.

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.

BBQRAM(num_bitstrings, size_bitstring, num_wires)

Resource class for BBQRAM.

BasisRotation([dim, wires])

Resource class for the BasisRotation gate.

ControlledSequence(base, num_control_wires)

Resource class for the ControlledSequence gate.

GQSP(signal_operator, d_plus[, d_minus, ...])

Resource class for the Generalized Quantum Signal Processing (GQSP) algorithm.

GQSPTimeEvolution(walk_op, time, one_norm[, ...])

Resource class for performing Hamiltonian simulation using GQSP.

IQP(num_wires, pattern[, spin_sym, wires])

Resource class for the Instantaneous Quantum Polynomial (IQP) template.

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 Quantum Read-Only Memory (QROM) template.

QROMStatePreparation(num_state_qubits[, ...])

Resource class for the QROMStatePreparation template.

QSP(block_encoding, poly_deg[, convention, ...])

Implements the Quantum Signal Processing (QSP) circuit.

QSVT(block_encoding, encoding_dims, poly_deg)

Resource class for Quantum Singular Value Transformation (QSVT).

Qubitization(prep_op, select_op[, wires])

Resource class for the Qubitization operator.

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

Resource class for qubitization of tensor hypercontracted Hamiltonian.

Reflection([num_wires, U, alpha, wires])

Resource class for the Reflection operator.

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.

SelectPauli(pauli_ham[, wires])

Resource class for the Select opreation used with a Hamiltonian expressed as a linear combination of unitaries (LCU) where each unitary is a Pauli word.

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

Resource class for the uniformly controlled rotation gate.

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

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.

TrotterPauli(pauli_ham, num_steps, order[, ...])

A resource operation representing the Suzuki-Trotter product approximation for the complex matrix exponential of a Hamiltonian represented as a linear combination of tensor products of Pauli operators.

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.

UnaryIterationQPE(walk_op, num_iterations[, ...])

Resource class for Quantum Phase Estimation (QPE) using the unary iteration technique.

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.

PauliHamiltonian(num_qubits, pauli_terms[, ...])

Stores the minimum necessary information required to estimate resources for a Hamiltonian expressed as a linear combination of tensor products of Pauli operators.

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.

QPE Resource Classes

FirstQuantization(n, eta[, omega, error, ...])

Estimate the number of non-Clifford gates and logical qubits for a quantum phase estimation algorithm in first quantization using a plane-wave basis.

DoubleFactorization(one_electron, two_electron)

Estimate the number of non-Clifford gates and logical qubits for a quantum phase estimation algorithm in second quantization with a double-factorized Hamiltonian.

Measurement Functions

estimate_shots(coeffs[, variances, error])

Estimate the number of measurements required to compute an expectation value with a target error.

estimate_error(coeffs[, variances, shots])

Estimate the error in computing an expectation value with a given number of measurements.

Contents

Using PennyLane

Release news

Development

API

Internals