|
The Unitary matrix can either be entered directly or as a Hermitian matrix
which will be exponentiated to obtain the unitary matrix.
In either case, there is a great deal of flexibility in entering the matrix itself.
A matrix can be entered directly with the syntax "M( (x,x,x,x) , (x,x,x,x), (x,x,x,x) , (x,x,x,x) )",
or calculated from other matrices eg: "II*cos(pi/7)+i*sin(pi/7)*XX"
Note the following:
- Whitespace is ignored
- Complex numbers can be entered using 'i' such as: 1+2*i
- constants e and pi are available
- usual math operators are available
- acos(x), acosh(x), asin(x), asinh(x), atan(x), atanh(x), cos(x), cosh(x)
exp(x), log(x), log10(x), sin(x), sinh(x), sqrt(x), tan(x), tanh(x)
- The pauli sigma-matrices are available as: I, X, Y, Z.
- Some other matrices: H (Hadamard), CNOT, SWAP
- single qubit matrices can be tensored together using tensor(A,B) or A&B,
for convenience all tensored combinations of the Pauli matrices are available
eg XY (= tensor(X,Y))
- Matrices can be multiplied together e.g. XX*(H&Y)
- The conjugate transpose is available as ".d" eg (H&Y).d
|