Creates a uniform superposition state on the states \([0, M)\) The gate creates the state \(\frac{1}{\sqrt{M} }\sum_{j=0}^{M-1}\ket{j}\) (where \(1\leq M \leq 2^n\)), using n qubits, according to the Shukla-Vedula algorithm [SV24].
Returns a controlled version of this gate.
If no arguments are
specified, defaults to a single qubit control.
Args
num_controls
Total number of control qubits.
control_values
Which control computational basis state to apply the
sub gate. A sequence of length num_controls where each
entry is an integer (or set of integers) corresponding to the
computational basis state (or set of possible values) where that
control is enabled. When all controls are enabled, the sub gate is
applied. If unspecified, control values default to 1.
control_qid_shape
The qid shape of the controls. A tuple of the
expected dimension of each control qid. Defaults to
(2,) * num_controls. Specify this argument when using qudits.
Returns
A cirq.Gate representing self controlled by the given control values
and qubits. This is a cirq.ControlledGate in the base
implementation, but subclasses may return a different gate type.
Returns a list of operations applying the gate to all targets.
Args
*targets
The qubits to apply this gate to. For single-qubit gates
this can be provided as varargs or a combination of nested
iterables. For multi-qubit gates this must be provided as an
Iterable[Sequence[Qid]], where each sequence has num_qubits
qubits.
Returns
Operations applying this gate to the target qubits.
Raises
ValueError
If targets are not instances of Qid or Iterable[Qid].
If the gate qubit number is incompatible.
TypeError
If a single target is supplied and it is not iterable.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-08 UTC."],[],[]]