PDGate
- class PDGate(index, radix=3)[source]
Bases:
QuditGate,CachedClassThe one-qudit P[i] gate.
The clock gate is given by the following formula:
![P[i]_d = \sum_{j} (-\omega^2)^{\delta_{ij}} |j\rangle\langle j|](../../_images/math/3af892a40de364140923406ac2e6c6222f63dbb9.png)
where

and d is the number of levels (2 levels is a qubit, 3 levels is a qutrit, etc.)
- __init__(index, radix=3)[source]
Construct a PDGate.
- Parameters:
index (
int) – The level for the phase qudit gate (<radix).radix (
int) – The number of qudit levels (>=2). Defaults to qutrits.
- Raises:
ValueError – if radix < 2
ValueError – if index >= radix
Attributes
The matrix dimension for this unitary.
The name of this gate.
The number of real parameters this unitary-valued function takes.
The number of qudits this unitary can act on.
The qasm identifier for this gate.
The number of levels in each qudit.
The number of orthogonal states for each qudit.
Methods
check_parameters(params)Check parameters are valid and match the unitary.
get_grad([params])Return the gradient for the unitary map as an np.ndarray.
Return the gate's inverse as a gate.
get_inverse_params([params])Return the parameters that invert the gate.
get_qasm(params, location)Returns the qasm string for this gate.
Returns a qasm gate definition block for this gate.
get_unitary([params])Return the unitary for this gate.
get_unitary_and_grad([params])Return a tuple combining the outputs of get_unitary and get_grad.
Return true if this unitary doesn't take parameters.
Return true if this gate has a gradient definition.
Return true if this unitary is parameterized.
Return true if this unitary can only act on qubits.
is_qudit_only(radix)Return true if this unitary can only act on radix-qudits.
Return true if this unitary can only act on qutrits.
is_self_inverse([params])Checks whether the unitary is its own inverse.
with_all_frozen_params(params)Freeze all of a gate's parameters so they don't change from optimization.
with_frozen_params(frozen_params)Freeze some of a gate's parameters so they don't change from optimization.