Home Reference Source
``import {UniformlyControlledRz} from 'projectq/src/ops/uniformly_controlled_rotation.js'``
public class

# UniformlyControlledRz

#### Extends:

BasicGate → UniformlyControlledRz

Uniformly controlled Rz 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 Rz(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() UniformlyControlledRz(angles=[0.1, 0.2, 0.3, 0.4]) | (controls, target)

Note: The first quantum register are the contains 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 Rz.

Args: angles(list[float]): Rotation angles. Rz(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 equal(other: *): boolean public getInverse(): * public getMerged(other: *): * public toString(): string

## Inherited Summary

 From class BasicGate public static makeTupleOfQureg(qubits: Qubit | Qubit[] | Qureg | Qureg[]): Qureg[] Convert quantum input of "gate | quantum input" to internal formatting. public public copy(): BasicGate public equal(other: BasicGate | Object): boolean public generateCommand(qubits: *): Command Helper function to generate a command consisting of the gate and the qubits being acted upon. public public public inspect(): string public or(qubits: *) Operator| overload which enables the syntax Gate | qubits. public toString()

## Public Constructors

### publicconstructor(angles: number[]) source

#### Override:

BasicGate#constructor

#### Params:

 Name Type Attribute Description angles number[]

## Public Methods

### publicequal(other: *): boolean source

BasicGate#equal

#### Params:

 Name Type Attribute Description other *

### publicgetInverse(): * source

#### Override:

BasicGate#getInverse

 *

### publicgetMerged(other: *): * source

#### Override:

BasicGate#getMerged

#### Params:

 Name Type Attribute Description other *

 *

### publictoString(): string source

#### Override:

BasicGate#toString