In depth: vqeeCalculator
vqeeCalculator
is a command-line executable for accessing Qristal’s MPI-enabled Variational Quantum Eigensolver (VQE) functionality.
Compiling
cd $QRISTAL_INSTALL_DIR/examples/cpp/vqeeCalculator
mkdir build
cd build
cmake .. -DENABLE_MPI=ON
make
Limitations
Noise model: none
JSON input and output
Instead of supplying command line options, vqeeCalculator
reads a JSON file (and output results to another JSON file) when called with these options:
mpiexec -n 2 vqeeCalculator --fromJson=$json_input_file --jsonID=0 --outputJson=$json_output_file
Input
The fields that are recognized in $json_input_file
are shown below:
Key |
Example value |
Details |
---|---|---|
|
|
Number of physical qubits |
|
|
Number of circuit execution shots |
|
|
Qubit Hamiltonian expressed as |
|
|
Alternative to specifying |
|
|
Predefined quantum circuit conditioned |
|
|
Number of particles in the ansatz |
|
See this link for information |
Alternative to specifying |
|
|
Initial values for ansatz parameters. |
|
|
Backend for executing quantum circuits |
|
|
Maximum iteration count |
|
|
Selects the algorithm used for optimization |
|
|
Extra options specific |
|
|
When set to |
|
|
Enable convergence trace |
|
|
Enable the display of |
|
|
Function tolerance |
|
|
Number of OpenMP |
Example JSON input file
[
{
"nQubits": 5,
"acceleratorName": "qpp",
"pauli": "0.00021123007138713814 +-0.0004797898199899509 X1 Z2 X3 +-0.0004797898199899509 Y1 Z2 Y3 +-0.0008504196943407897 Z1 +-0.0004797898199899509 X2 Z3 X4 +-0.0004797898199899509 Y2 Z3 Y4 +-0.0008504196943407897 Z2 +-0.0009971065473443474 Z3 +-0.0009971065473443474 Z4",
"ansatz": "ASWAP",
"nElectrons": 2,
"maxIters": 1,
"tolerance": 1e-05,
"nShots": 1,
"isDeterministic": true,
"thetas": [
0.19282382007161974,
0.2635945440300202,
-0.04929291223947813,
0.04121265889451157,
0.16609364599654375,
0.2502175895079587,
0.0488588580664832,
1.6109279933369605,
2.921249087681776
]
}
]
Output
The fields that are output in $json_output_file
are shown below:
Key |
Details |
---|---|
|
The optimum (min.) energy at |
|
Number of iterations reached |
|
The Hamiltonian expressed as |
|
The value of the ansatz parameters |
|
Energy and ansatz parameter |
|
The execution wall time, in ms |
Example output JSON file
{
"energy": -6.722747367844044e-05,
"iterations": 1,
"pauli": "0.00021123007138713814 +-0.0004797898199899509 X1 Z2 X3 +-0.0004797898199899509 Y1 Z2 Y3 +-0.0008504196943407897 Z1 +-0.0004797898199899509 X2 Z3 X4 +-0.0004797898199899509 Y2 Z3 Y4 +-0.0008504196943407897 Z2 +-0.0009971065473443474 Z3 +-0.0009971065473443474 Z4",
"theta": [
0.19282382007161974,
0.2635945440300202,
-0.04929291223947813,
0.04121265889451157,
0.16609364599654375,
0.2502175895079587,
0.0488588580664832,
1.6109279933369605,
2.921249087681776
],
"walltime_ms": 30.81
}