Takes as input a gate and generates the matrix for that gate being applied to a single qubit in a ket by creating a tensor product of the matrix with Identity matrices. If a ket is supplied, the matrix will be applied to the ket
Usage
single(gate,n,t,...)
Arguments
gate
Single qubit gate to apply
n
Number of qubits that are in the target ket
t
Target qubit that the gate will be applied to, other qubits are unmodified. Indexed from 0.
...
Either no argument or a ket that the gate will be applied to
Value
The matrix representing the application of a single gate to one of the qubits in a ket or a ket after the gate has been applied