qp.labs.estimator_beta

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

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

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

LabsResourceConfig()

Sets the values of precisions and custom decompositions when estimating resources for a quantum workflow (see also ResourceConfig).

mark_subroutine(qfunc[, include_params, ...])

A decorator that can be used to promote a quantum function to a resource operator.

ResourceQfunc(name_, resource_decomp_fn_, ...)

Resource class for a quantum function (qfunc) promoted to a resource operator.

Qubit Tracking Functionality

Allocate(num_wires[, state, restored])

A class used to represent the allocation of auxiliary wires to be used in the resource decomposition of a ResourceOperator.

Deallocate([num_wires, allocated_register, ...])

A class used to represent the deallocation of auxiliary wires that were used in the resource decomposition of a ResourceOperator.

estimate_wires_from_circuit(circuit_as_lst)

Determine the number of auxiliary qubits needed to decompose the operators of a quantum circuit into a specific gate_set with a given config.

estimate_wires_from_resources(workflow[, ...])

Determine the number of auxiliary qubits needed to decompose the operators in a Resources object into a specific gate_set with a given config.

MarkClean(wires)

A class used to mark that certain wires are in the zero state.

MarkQubits(wires)

A base class used to mark the state of certain wire labels.

State Preparation

LabsMottonenStatePreparation(num_wires[, wires])

Resource class for Mottonen state preparation.

LabsCosineWindow(num_wires[, wires])

Resource class for preparing an initial state with a cosine wave function.

LabsSumOfSlatersPrep(num_coeffs, num_wires)

Resource class for preparing an initial state with the sum-of-Slaters technique.

Alternate Decompositions

aqft_resource_decomp(order, num_wires)

Returns a list representing the resources of the operator.

ch_resource_decomp()

Returns a list of GateCount objects representing the resources of the CH operator.

ch_toffoli_based_resource_decomp()

Returns a list representing the resources of the CH operator.

hadamard_controlled_resource_decomp(...[, ...])

Returns a list representing the resources for a controlled version of the Hadamard operator.

hadamard_toffoli_based_controlled_decomp(...)

Returns a list representing the resources for a controlled version of the Hadamard operator.

mcx_many_clean_aux_resource_decomp(...)

Returns a list representing the resources of the operator.

mcx_one_clean_aux_resource_decomp(...)

Returns a list representing the resources of the operator.

mcx_one_dirty_aux_resource_decomp(...)

Returns a list representing the resources of the operator.

paulirot_controlled_resource_decomp(...)

Returns a list representing the resources for a controlled version of the PauliRot operator.

qft_phase_grad_resource_decomp(num_wires)

Returns a list representing the resources of the operator.

qrom_state_preparation_phase_grad_resource_decomp(...)

Returns a list representing the resources of the operator.

qrom_state_preparation_resource_decomp(...)

Returns a list representing the resources of the operator.

selectpaulirot_controlled_resource_decomp(...)

Returns a list representing the resources of the controlled version of the SelectPauliRot operator.

select_thc_controlled_resource_decomp(...)

Returns a list representing the resources for the controlled version of the operator.

select_thc_resource_decomp(thc_ham[, ...])

Returns a list representing the resources of the operator.

Templates

OutOfPlaceIntegerComparator(value[, ...])

Resource class for an out-of-place integer comparator.

RegisterEquality([register_size, wires])

Resource class for testing the equality of two quantum registers.

LabsAdder(num_x_wires[, mod, wires])

Resource class for the inplace quantum-classical modular Adder gate.

LabsOutAdder(num_x_wires, num_y_wires, ...)

Resource class for the out-of-place quantum-quantum modular Adder gate.

LabsMultiplier(num_x_wires[, mod, wires])

Resource class for the inplace quantum-classical modular multiplication operation.

ClassicalOutMultiplier(num_x_wires, ...[, ...])

Resource class for the out-of-place quantum-classical modular multiplication operation.

LabsModExp(num_x_wires, num_output_wires[, ...])

Resource class for the out-of-place modular exponentiation operation.

LabsPhaseAdder(num_x_wires[, mod, wires])

Resource class for the PhaseAdder gate.

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

Resource class for the Quantum Read-Only Memory (QROM) template.

SelectCopyQROM(num_bitstrings, size_bitstring)

Resource class for the Select-Copy variant of Quantum Read-Only Memory (QROM) template.