import {UniformlyControlledRy} from 'projectq/src/ops/uniformly_controlled_rotation.js'
UniformlyControlledRy
Extends:
Uniformly controlled Ry gate as introduced in arXiv:quant-ph/0312218.
This is an n-qubit gate. There are n-1 control qubits and one target qubit. This gate applies Ry(angles(k)) to the target qubit if the n-1 control qubits are in the classical state k. As there are 2^(n-1) classical states for the control qubits, this gate requires 2^(n-1) (potentially different) angle parameters.
Example: .. code-block:: python
controls = eng.allocate_qureg(2) target = eng.allocate_qubit() UniformlyControlledRy(angles=[0.1, 0.2, 0.3, 0.4]) | (controls, target)
Note: The first quantum register contains the control qubits. When converting the classical state k of the control qubits to an integer, we define controls[0] to be the least significant (qu)bit. controls can also be an empty list in which case the gate corresponds to an Ry.
Args: angles(list[float]): Rotation angles. Ry(angles[k]) is applied conditioned on the control qubits being in state k.
Constructor Summary
Public Constructor | ||
public |
constructor(angles: number[]) |
Member Summary
Public Members | ||
public |
angles: * |
Method Summary
Public Methods | ||
public |
|
|
public |
getInverse(): * |
|
public |
getMerged(other: *): * |
|
public |
|
Inherited Summary
From class BasicGate | ||
public static |
Convert quantum input of "gate | quantum input" to internal formatting. |
|
public |
|
|
public |
|
|
public |
|
|
public |
generateCommand(qubits: *): Command Helper function to generate a command consisting of the gate and the qubits being acted upon. |
|
public |
|
|
public |
|
|
public |
|
|
public |
or(qubits: *) Operator| overload which enables the syntax Gate | qubits. |
|
public |
toString() |
Public Constructors
public constructor(angles: number[]) source
Override:
BasicGate#constructorParams:
Name | Type | Attribute | Description |
angles | number[] |
Public Members
public angles: * source
Public Methods
public equal(other: *): boolean source
Override:
BasicGate#equalParams:
Name | Type | Attribute | Description |
other | * |
public getMerged(other: *): * source
Override:
BasicGate#getMergedParams:
Name | Type | Attribute | Description |
other | * |
Return:
* |