InitialState - Maple Help

QuantumComputing

 InitialState
 prepare an initial quantum state

 Calling Sequence Parameters Description

 Calling Sequence InitialState(nqubits, options)
 Parameters

 nqubits - posint; positive integer indicating the number of qubits options - The optional keyword dirac can be set to true (default) or false to determine whether the initial state is returned in Dirac notation or Array notation.

Description

 • The InitialState command accepts a positive integer indicating the number of qubits.
 • The InitialState command returns an initial state with all qubits in the lower (or 0) state.
 • The optional boolean keyword dirac determines whether the initial state is returned in Dirac notation (true) or Array notation (false).
 • In Dirac notation the number of qubits is represented by the number of indices on the wave function symbol; in Array notation the number of qubits is represented by the number of dimensions of the Array.
 • The two states of each qubit are denoted as 0 and 1 in Dirac notation; they are represented by the range 1..2 of each dimension in Array notation.

Examples

First we load the QuantumChemistry package

 > $\mathrm{with}\left(\mathrm{QuantumChemistry}\right):$

Next we load the QuantumComputing subpackage

 > $\mathrm{with}\left(\mathrm{QuantumComputing}\right);$
 $\left[{\mathrm{ConvertDirac}}{,}{\mathrm{Gate}}{,}{\mathrm{InitialState}}{,}{\mathrm{MeasureState}}{,}{\mathrm{PrepareState}}{,}{\mathrm{QubitPopulations}}{,}{\mathrm{QubitPopulationsPlot}}\right]$ (1)

We can initialize a state of 4 qubits on our simulated quantum computer with the InitialState command

 >
 ${\mathrm{state0}}{≔}{{\mathrm{\Psi }}}_{{0}{,}{0}{,}{0}{,}{0}}$ (2)

or using dirac = true, we have

 >
 >