First we load the QuantumChemistry package
>
|
|
Next we load the QuantumComputing subpackage
>
|
|
| (1) |
Now Maple knows the standard 1- and 2-qubit gates. For example, Pauli Z gate
or the Pauli X and Y gates
>
|
|
or the most general 1-qubit gate, known as the U (universal) gate that depends on 3 angles that we keep symbolic
>
|
|
| (4) |
or a 2-qubit gate like the CNOT gate
| (5) |
We can initialize a state of 4 qubits on our simulated quantum computer with the InitialState command
>
|
|
The initial wave function has each of its 4 qubits in the lower state of the qubit, denoted by 0. To illustrate preparing a state on the quantum computer, let's use a product of gates (unitary transformations), known as a circuit, to prepare a Schrodinger cat state in which the state of all qubits down becomes entangled with the state of all qubits up. In QCT the circuit is readily assemble as a Maple list of equations. The left side of an equation indicates the qubit or qubits on which the gate acts and the right side provides the gate itself.
>
|
|
| (7) |
To prepare the new state, we act on the initial state state0 with our circuit
>
|
|
| (8) |
The new state entangles a state of 4 "down" qubits with a state of 4 "up" qubits. Like Schrodinger's cat, our state is half up and half down. The probability of being "up" in each qubit is 1/2 as we can see from the QubitPopulationsPlot command
>
|
|