Overview of the QuantumComputing Package
Calling Sequence Description List of QuantumComputing Package Commands
Accessing QuantumComputing Package Commands References Examples
Calling Sequence
QuantumChemistry:-QuantumComputing:-command(arguments) QuantumComputing:-command(arguments) command(arguments)
Description
The QuantumComputing package is an environment for performing 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.
The QuantumComputing package is a subpackage of the QuantumChemistry package.
List of QuantumComputing Package Commands
The following is a list of commands available in the QuantumComputing package:
ConvertDirac
Gate
InitialState
MeasureState
PrepareState
QubitPopulations
QubitPopulationsPlot
Accessing QuantumComputing Package Commands
Each command in the QuantumComputing package can be accessed by (1) loading the commands of the QuantumChemistry package the command with(QuantumChemistry) and loading the commands of the QuantumComputing subpackage via with(QuantumComputing) and (2) calling each command as Command(arguments) with appropriate arguments as described in the command's help page. See the short form for additional details.
Each command in the QuantumComputing package can be accessed by (1) loading the commands of the QuantumChemistry package the command with(QuantumChemistry) and (2) calling each command as either QuantumComputing[Command](arguments) or QuantumComputing:-Command(arguments) with appropriate arguments as described in the command's help page.
Each command in the QuantumComputing package can be accessed without loading either the QuantumChemistry package or the QuantumComputing subpackage via the following two formats: (1) QuantumChemistry[QuantumComputing][Command](arguments) or (2) QuantumChemistry:-QuantumComputing:-Command(arguments) with appropriate arguments as described in the command's help page. See the long form for additional details.
References
M. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information (Cambridge University Press, Cambridge, 2000).
D. McMahon, Quantum Computing Explained (John Wiley & Sons, New York, 2007).
W. Scherer, Mathematics of Quantum Computing (Springer, New York, 2019).
G. Benenti, G. Casati, D. Rossini, and G. Strini, Principles of Quantum Computation and Information: A Comprehensive Textbook (World Scientific Publishing Company, London, 2019).
Amira Abbas and Stina Andersson and Abraham Asfaw and Antonio Corcoles and Luciano Bello and Yael Ben-Haim and Mehdi Bozzo-Rey and Sergey Bravyi and Nicholas Bronn and Lauren Capelluto and Almudena Carrera Vazquez and Jack Ceroni and Richard Chen and Albert Frisch and Jay Gambetta and Shelly Garion and Leron Gil and Salvador De La Puente Gonzalez and Francis Harkins and Takashi Imamichi and Pavan Jayasinha and Hwajung Kang and Amir h. Karamlou and Robert Loredo and David McKay and Alberto Maldonado and Antonio Macaluso and Antonio Mezzacapo and Zlatko Minev and Ramis Movassagh and Giacomo Nannicini and Paul Nation and Anna Phan and Marco Pistoia and Arthur Rattew and Joachim Schaefer and Javad Shabani and John Smolin and John Stenger and Kristan Temme and Madeleine Tod and Ellinor Wanzambi and Stephen Wood and James Wootton, Learn Quantum Computation using Qiskit (IBM, Heightstown, New York, 2023). https://qiskit.org/textbook/preface.html
Examples
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
We can initialize a state of 4 qubits on our simulated quantum computer with the InitialState command
state0 ≔ InitialState4;
state0≔Ψ0,0,0,0
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.
circuit ≔ 1= GateH,seqi,i+1=GateCNOT, i=1..3;
circuit≔1=222222−22,1,2=1000000100100100,2,3=1000000100100100,3,4=1000000100100100
To prepare the new state, we act on the initial state state0 with our circuit
state2 ≔ PrepareStatecircuit,state0;
state2≔2⁢Ψ0,0,0,02+2⁢Ψ1,1,1,12
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
QubitPopulationsPlotstate2;
See Also
QuantumChemistry What's New 2023
Download Help Document