qml.estimator.templates.OutMultiplier¶
- class OutMultiplier(a_num_wires, b_num_wires, wires=None)[source]
Bases:
ResourceOperator
Resource class for the OutMultiplier gate.
- Parameters:
a_num_wires (int) – the size of the first input register
b_num_wires (int) – the size of the second input register
wires (Sequence[int], None) – the wires the operation acts on
- Resources:
The resources are obtained from appendix G, lemma 10 in PRX Quantum, 2, 040332 (2021).
See also
The corresponding PennyLane operation
OutMultiplier
.Example
The resources for this operation are computed using:
>>> import pennylane.estimator as qre >>> out_mul = qre.OutMultiplier(4, 4) >>> print(qre.estimate(out_mul)) --- Resources: --- Total wires: 16 algorithmic wires: 16 allocated wires: 0 zero state: 0 any state: 0 Total gates : 70 'Toffoli': 14, 'CNOT': 14, 'Hadamard': 42
Attributes
Returns a dictionary containing the minimal information needed to compute the resources.
- resource_keys = {'a_num_wires', 'b_num_wires'}¶
- resource_params¶
Returns a dictionary containing the minimal information needed to compute the resources.
- Returns:
- A dictionary containing the resource parameters:
a_num_wires (int): the size of the first input register
b_num_wires (int): the size of the second input register
- Return type:
dict
Methods
resource_decomp
(a_num_wires, b_num_wires)Returns a list representing the resources of the operator.
resource_rep
(a_num_wires, b_num_wires)Returns a compressed representation containing only the parameters of the Operator that are needed to compute a resource estimation.
- classmethod resource_decomp(a_num_wires, b_num_wires)[source]¶
Returns a list representing the resources of the operator. Each object in the list represents a gate and the number of times it occurs in the circuit.
- Parameters:
a_num_wires (int) – the size of the first input register
b_num_wires (int) – the size of the second input register
- Resources:
The resources are obtained from appendix G, lemma 10 in PRX Quantum, 2, 040332 (2021).
- Returns:
A list of GateCount objects, where each object represents a specific quantum gate and the number of times it appears in the decomposition.
- Return type:
list[
GateCount
]
- classmethod resource_rep(a_num_wires, b_num_wires)[source]¶
Returns a compressed representation containing only the parameters of the Operator that are needed to compute a resource estimation.
- Parameters:
a_num_wires (int) – the size of the first input register
b_num_wires (int) – the size of the second input register
- Returns:
the operator in a compressed representation
- Return type: