qml.labs.estimator_beta.ops.hadamard_controlled_resource_decomp¶
- hadamard_controlled_resource_decomp(num_ctrl_wires, num_zero_ctrl, target_resource_params=None)[source]¶
Returns a list representing the resources for a controlled version of the
Hadamardoperator.- Parameters:
num_ctrl_wires (int) – the number of qubits the operation is controlled on
num_zero_ctrl (int) – the number of control qubits, that are controlled when in the \(|0\rangle\) state
target_resource_params (dict | None) – A dictionary containing the resource parameters of the target operator.
- Resources:
For a single control wire, the cost is a single instance of
CH. Two additionalXgates are used to flip the control qubit if it is zero-controlled. In the case where multiple controlled wires are provided, the resources are derived from the following identities:\[\begin{split}\begin{align} \hat{H} &= \hat{R}_{y}(\frac{\pi}{4}) \cdot \hat{Z} \cdot \hat{R}_{y}(\frac{-\pi}{4}), \\ \hat{Z} &= \hat{H} \cdot \hat{X} \cdot \hat{H}. \end{align}\end{split}\]Specifically, the resources are given by two
RYgates, twoHadamardgates and aXgate. By replacing theXgate withMultiControlledXgate, we obtain a controlled-version of this identity.Decomposing the \(\hat{R}_y(\pm\frac{\pi}{4})\) rotations into the Clifford+T basis and substituting yields:
\[\begin{split}\begin{align} \hat{H} &= (S H T H S^\dagger) \cdot \hat{Z} \cdot (S H T^\dagger H S^\dagger) \\ &= S H T \cdot (\hat{H} \hat{Z} \hat{H}) \cdot T^\dagger H S^\dagger \\ &= S H T \cdot \hat{X} \cdot T^\dagger H S^\dagger \end{align}\end{split}\]The final resources are: 2
Hadamard, 1T, 1Adjoint(T), 1S, 1Adjoint(S), and 1MultiControlledXcontrolled onnum_ctrl_wires.
- Returns:
A list of
GateCountobjects, where each object represents a specific quantum gate and the number of times it appears in the decomposition.- Return type:
list[
GateCount]