supergrad.utils.gates module

Contents

supergrad.utils.gates module#

The code is from qutip_qip.operations. Operations on quantum circuits.

List of Gates#

rx(phi[, n, target])

Single-qubit rotation for operator sigmax with angle phi.

ry(phi[, n, target])

Single-qubit rotation for operator sigmay with angle phi.

rz(phi[, n, target])

Single-qubit rotation for operator sigmaz with angle phi.

sqrtnot([n, target])

Single-qubit square root NOT gate.

snot([n, target])

Quantum object representing the SNOT (Hadamard) gate.

phasegate(theta[, n, target])

Returns quantum object representing the phase shift gate.

qrot(theta, phi[, n, target])

Single qubit rotation driving by Rabi oscillation with 0 detune.

x_gate([n, target])

Pauli-X gate or sigmax operator.

y_gate([n, target])

Pauli-Y gate or sigmay operator.

z_gate([n, target])

Pauli-Z gate or sigmaz operator.

cy_gate([n, control, target])

Controlled Y gate.

cz_gate([n, control, target])

Controlled Z gate.

s_gate([n, target])

Single-qubit rotation also called Phase gate or the Z90 gate.

t_gate([n, target])

Single-qubit rotation related to the S gate by the relationship S=T*T.

qasmu_gate(args[, n, target])

QASM U-gate as defined in the OpenQASM standard.

cs_gate([n, control, target])

Controlled S gate.

ct_gate([n, control, target])

Controlled T gate.

cphase(theta[, n, control, target])

Returns quantum object representing the controlled phase shift gate.

cnot([n, control, target])

Quantum object representing the CNOT gate.

csign([n, control, target])

Quantum object representing the CSIGN gate.

berkeley([n, targets])

Quantum object representing the Berkeley gate.

swapalpha(alpha[, n, targets])

Quantum object representing the SWAPalpha gate.

swap([n, targets])

Quantum object representing the SWAP gate.

iswap([n, targets])

Quantum object representing the iSWAP gate.

sqrtswap([n, targets])

Quantum object representing the square root SWAP gate.

sqrtiswap([n, targets])

Quantum object representing the square root iSWAP gate.

fredkin([n, control, targets])

Quantum object representing the Fredkin gate.

molmer_sorensen(theta[, n, targets])

Quantum object of a Mølmer–Sørensen gate.

toffoli([n, controls, target])

Quantum object representing the Toffoli gate.

rotation(op, phi[, n, target])

Single-qubit rotation for operator op with angle phi.

controlled_gate(u[, n, control, target, ...])

Create an N-qubit controlled gate from a single-qubit gate U with the given

globalphase(theta[, n])

Returns quantum object representing the global phase shift gate.

hadamard_transform([n])

Quantum object representing the N-qubit Hadamard gate.

expand_operator(oper, n, targets[, dims, ...])

Expand an operator to one that acts on a system with desired dimensions.