Use Quantum Chemistry Toolbox 2023 to explore quantum computing with the power of computer algebra. Perform simulations of a quantum computer in Maple. Unlike most simulators, Maple can compute with both exact arithmetic (i.e. rational and irrational numbers) and symbolic variables. The wave function is printed using an easy-to-understand Dirac-like notation. First, load the new QuantumComputing subpackage
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,
or a 2-qubit gate like the CNOT gate.
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, 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 the Quantum Chemistry Toolbox, the circuit is readily assembled 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.
To prepare the new state, we act on the initial state state0 with our circuit.
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 1/2 as we can see from the QubitPopulationsPlot command