qml.estimator.ops.SingleExcitation¶
- class SingleExcitation(precision=None, wires=None)[source]
Bases:
ResourceOperator
Resource class for the SingleExcitation gate.
- Parameters:
precision (float, optional) – error threshold for Clifford + T decomposition of this operation
wires (Sequence[int], optional) – the wires the operation acts on
- Resources:
The resources are obtained by decomposing the following matrix into fundamental gates.
\[\begin{split}U(\phi) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos(\phi/2) & -\sin(\phi/2) & 0 \\ 0 & \sin(\phi/2) & \cos(\phi/2) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}.\end{split}\]This transformation can be expressed with the following decomposition:
0: ──T†──H───S─╭X──RZ-─╭X──S†──H──T─┤ 1: ──T†──S†──H─╰●──RY──╰●──H───S──T─┤
See also
The corresponding PennyLane operation
SingleExcitation
.Example
The resources for this operation are computed using:
>>> import pennylane.estimator as qre >>> se = qre.SingleExcitation() >>> print(qre.estimate(se)) --- Resources: --- Total wires: 2 algorithmic wires: 2 allocated wires: 0 zero state: 0 any state: 0 Total gates : 108 'T': 92, 'CNOT': 2, 'Z': 4, 'S': 6, 'Hadamard': 4
Attributes
Returns a dictionary containing the minimal information needed to compute the resources.
- num_wires = 2¶
- resource_keys = {'precision'}¶
- resource_params¶
Returns a dictionary containing the minimal information needed to compute the resources.
- Returns:
- A dictionary containing the resource parameters:
precision (float): error threshold for clifford plus T decomposition of this operation
- Return type:
dict
Methods
resource_decomp
([precision])Returns a list of GateCount objects representing the operator's resources.
resource_rep
([precision])Returns a compressed representation containing only the parameters of the Operator that are needed to compute a resource estimation.
- classmethod resource_decomp(precision=None)[source]¶
Returns a list of GateCount objects representing the operator’s resources.
- Parameters:
precision (float, optional) – error threshold for clifford plus T decomposition of this operation
- Resources:
The resources are obtained by decomposing the following matrix into fundamental gates.
\[\begin{split}U(\phi) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos(\phi/2) & -\sin(\phi/2) & 0 \\ 0 & \sin(\phi/2) & \cos(\phi/2) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}.\end{split}\]The cost for implementing this transformation is given by:
0: ──T†──H───S─╭X──RZ-─╭X──S†──H──T─┤ 1: ──T†──S†──H─╰●──RY──╰●──H───S──T─┤
- 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[~.pennylane.estimator.resource_operator.GateCount]
- classmethod resource_rep(precision=None)[source]¶
Returns a compressed representation containing only the parameters of the Operator that are needed to compute a resource estimation.
- Parameters:
precision (float, optional) – error threshold for clifford plus T decomposition of this operation
- Returns:
the operator in a compressed representation
- Return type: