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 Hadamard operator.

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 additional X gates 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 RY gates, two Hadamard gates and a X gate. By replacing the X gate with MultiControlledX gate, 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, 1 T, 1 Adjoint(T), 1 S, 1 Adjoint(S), and 1 MultiControlledX controlled on num_ctrl_wires.

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]