QuantumComputing
Gate
return a quantum gate
Calling Sequence Parameters Description
Examples
Calling Sequence
Gate(gatestr, options) Gate()
Parameters
gatestr
-
string; symbol of the quantum gate
options
name or algebraic; if the gate depends on angles, then any of the three angles, lambda, phi, and theta, can be set as optional keyword parameters; they can be set to any algebraic expression including integers, rational and irrational numbers, constants like Pi, symbols, and polynomials.
Description
The Gate command converts a string symbol of the quantum gate into a Matrix representation of the gate.
The Gate command without arguments yields a list of the known gates.
First we load the QuantumChemistry package
with⁡QuantumChemistry:
Next we load the QuantumComputing subpackage
withQuantumComputing;
ConvertDirac,Gate,InitialState,MeasureState,PrepareState,QubitPopulations,QubitPopulationsPlot
Now Maple knows the standard 1- and 2-qubit gates. For example, Pauli Z gate
Uz ≔ GateZ;
Uz≔100−1
or the Pauli X and Y gates
Uz,Uy ≔ GateX,GateY;
Uz,Uy≔0110,0−II0
or the most general 1-qubit gate, known as the U (universal) gate that depends on 3 angles that we keep symbolic
Uu ≔ GateU,theta=theta,phi=phi,lambda=lambda;
Uu≔cos⁡θ2−ⅇI⁢λ⁢sin⁡θ2ⅇI⁢φ⁢sin⁡θ2ⅇI⁢φ+λ⁢cos⁡θ2
or a 2-qubit gate like the CNOT gate
Ucnot ≔ GateCNOT;
Ucnot≔1000000100100100
All known gates can be returned by calling the command without arguments
Gate;
CH,CNOT,CP,CPhase,CS,CT,CU,CX,CY,CZ,H,I,P,Rx,Ry,Rz,S,SWAP,T,U,X,Y,Z,fSWAP,iSWAP
See Also
QuantumChemistry QuantumComputing
Download Help Document