gates

Contents

gates#

Gates in a discopy.quantum.circuit.Circuit.

Summary#

SelfConjugate

A self-conjugate box, i.e. where the transpose is the dagger.

AntiConjugate

An anti-conjugate box, i.e. where the conjugate is the dagger.

Discard

Discard n qubits.

MixedState

Maximally-mixed state on n qubits.

Measure

Measure n qubits into n bits.

Encode

Controlled preparation, i.e. encode n bits into n qubits.

QuantumGate

Quantum gates, i.e. unitaries on n qubits.

ClassicalGate

Classical gates, i.e. from digits to digits.

Copy

Takes a bit, returns two copies of it.

Match

Takes two bits in, returns them if they are equal.

Digits

Classical state for a given string of digits of a given dimension.

Bits

Ket

Implements qubit preparation for a given bitstring.

Bra

Implements qubit post-selection for a given bitstring.

Controlled

Abstract class for controled quantum gates.

Parametrized

Abstract class for parametrized boxes in a quantum circuit.

Rotation

Abstract class for rotation gates.

Rx

X rotations.

Ry

Y rotations.

Rz

Z rotations.

CU1

Controlled U1 rotations.

CRz

Controlled Z rotations.

CRx

Controlled X rotations.

Scalar

Scalar, i.e. quantum gate with empty domain and codomain.

MixedScalar

Mixed scalar, i.e. where the Born rule has already been applied.

Sqrt

Square root.

Functions

sqrt

Returns a 0-qubit quantum gate that scales by a square root.

scalar

Returns a 0-qubit quantum gate that scales by a complex number.