Blog

Finding the Ground State of H2O and Solving Other Hamiltonian Simulation Problems with Classiq

26
July
,
2022

This note demonstrates how to use the Classiq platform to solve the Hamiltonian Simulation problem that was part of our recent coding competition. We then demonstrate a more complex example - simulating an H2O molecule.

Introduction

Chemical simulation is one of the most exciting applications for quantum computers. When precise simulations of electron-electron interactions are necessary, it is sometimes possible to use a classical computer, but classical computers struggle to simulate more complex molecular interactions. It is best to simulate these particle interactions at the quantum level, and an excellent way to do this is with a quantum computer.

The ability to accurately simulate molecular interactions will have extensive applications. When used for drug discovery, it will allow for the rapid development of vaccines and new cures for diseases. In materials research, we can hope to discover materials with higher strength-to-weight ratios and environmentally-friendly building materials.

The Lithium Hydride Hamiltonian Simulation Problem

In our recent coding competition, we asked contestants to generate a circuit, using no more than ten qubits, that approximates the unitary e−iH where H is the qubit hamiltonian of a LiH (lithium hydride) molecule. The LiH Hamiltonian is composed of 276 Pauli strings and can be found here. The approximation error should be less than 0.1, and the circuit should be composed only of the CX and single-qubit gates.

Coding with Classiq

To solve this problem with Classiq, we use the Suzuki Trotter method, one of the most efficient ways to simulate Hamiltonians and generate quantum simulation circuits. Creating this circuit is straightforward. We specify the desired function of the circuit, and the platform generates an efficient quantum circuit. Here is the code:


LiH = [("IIIYYIIIYY",0.00303465683020485),
("IIIXXIIIYY",0.00303465683020485),
("IIIYYIIIXX",0.00303465683020485),
("IIIXXIIIXX",0.00303465683020485),
("YZZZYIIIYY",-0.00837336142426481),
("XZZZXIIIYY",-0.00837336142426481),
("YZZZYIIIXX",-0.00837336142426481),
("XZZZXIIIXX",-0.00837336142426481),
("YZZYIIIIYY",0.00211113766859809),
("XZZXIIIIYY",0.00211113766859809),
("YZZYIIIIXX",0.00211113766859809),
("XZZXIIIIXX",0.00211113766859809),
("IIIIIIIIYY",-0.00491756976241806),
("IIIIIIIIXX",-0.00491756976241806),
("ZIIIIIIIYY",0.0105401874090264),
("ZIIIIIIIXX",0.0105401874090264),
("IZIIIIIIYY",-0.00118228323247258),
("IZIIIIIIXX",-0.00118228323247258),
("IIZIIIIIYY",-0.00118228323247258),
("IIZIIIIIXX",-0.00118228323247258),
("IIIZIIIIYY",-0.00154067008970742),
("IIIZIIIIXX",-0.00154067008970742),
("IIIIZIIIYY",0.0117336239120741),
("IIIIZIIIXX",0.0117336239120741),
("IIIIIZIIYY",0.00277574622690495),
("IIIIIZIIXX",0.00277574622690495),
("IIIIIIZIYY",0.00362024875588371),
("IIIIIIZIXX",0.00362024875588371),
("IIIIIIIZYY",0.00362024875588371),
("IIIIIIIZXX",0.00362024875588371),
("IIYZYIIYZY",0.00599676084973456),
("IIXZXIIYZY",0.00599676084973456),
("IIYZYIIXZX",0.00599676084973456),
("IIXZXIIXZX",0.00599676084973456),
("IIYYIIIYZY",0.00480253198835629),
("IIXXIIIYZY",0.00480253198835629),
("IIYYIIIXZX",0.00480253198835629),
("IIXXIIIXZX",0.00480253198835629),
("YZYIIIIYZY",-0.00487974048419149),
("XZXIIIIYZY",-0.00487974048419149),
("YZYIIIIXZX",-0.00487974048419149),
("XZXIIIIXZX",-0.00487974048419149),
("IYZZYIYZZY",0.00599676084973456),
("IXZZXIYZZY",0.00599676084973456),
("IYZZYIXZZX",0.00599676084973456),
("IXZZXIXZZX",0.00599676084973456),
("IYZYIIYZZY",0.00480253198835629),
("IXZXIIYZZY",0.00480253198835629),
("IYZYIIXZZX",0.00480253198835629),
("IXZXIIXZZX",0.00480253198835629),
("YYIIIIYZZY",-0.00487974048419149),
("XXIIIIYZZY",-0.00487974048419149),
("YYIIIIXZZX",-0.00487974048419149),
("XXIIIIXZZX",-0.00487974048419149),
("IIIYYYZZZY",-0.00837336142426481),
("IIIXXYZZZY",-0.00837336142426481),
("IIIYYXZZZX",-0.00837336142426481),
("IIIXXXZZZX",-0.00837336142426481),
("YZZZYYZZZY",0.0307383271773138),
("XZZZXYZZZY",0.0307383271773138),
("YZZZYXZZZX",0.0307383271773138),
("XZZZXXZZZX",0.0307383271773138),
("YZZYIYZZZY",-0.00776444118212153),
("XZZXIYZZZY",-0.00776444118212153),
("YZZYIXZZZX",-0.00776444118212153),
("XZZXIXZZZX",-0.00776444118212153),
("IIIIIYZZZY",-0.00594901997573424),
("IIIIIXZZZX",-0.00594901997573424),
("ZIIIIYZZZY",-0.0351167704024114),
("ZIIIIXZZZX",-0.0351167704024114),
("IZIIIYZZZY",0.00272988283532641),
("IZIIIXZZZX",0.00272988283532641),
("IIZIIYZZZY",0.00272988283532641),
("IIZIIXZZZX",0.00272988283532641),
("IIIZIYZZZY",0.00236793689958447),
("IIIZIXZZZX",0.00236793689958447),
("IIIIZYZZZY",-0.0330587285877558),
("IIIIZXZZZX",-0.0330587285877558),
("IIIIIYIZZY",-0.00214985764886508),
("IIIIIXIZZX",-0.00214985764886508),
("IIIIIYZIZY",-0.00214985764886508),
("IIIIIXZIZX",-0.00214985764886508),
("IIIIIYZZIY",0.00447907456818256),
("IIIIIXZZIX",0.00447907456818256),
("IIYZYIIYYI",0.00480253198835629),
("IIXZXIIYYI",0.00480253198835629),
("IIYZYIIXXI",0.00480253198835629),
("IIXZXIIXXI",0.00480253198835629),
("IIYYIIIYYI",0.0103288193223016),
("IIXXIIIYYI",0.0103288193223016),
("IIYYIIIXXI",0.0103288193223016),
("IIXXIIIXXI",0.0103288193223016),
("YZYIIIIYYI",-0.00346639184847533),
("XZXIIIIYYI",-0.00346639184847533),
("YZYIIIIXXI",-0.00346639184847533),
("XZXIIIIXXI",-0.00346639184847533),
("IYZZYIYZYI",0.00480253198835629),
("IXZZXIYZYI",0.00480253198835629),
("IYZZYIXZXI",0.00480253198835629),
("IXZZXIXZXI",0.00480253198835629),
("IYZYIIYZYI",0.0103288193223016),
("IXZXIIYZYI",0.0103288193223016),
("IYZYIIXZXI",0.0103288193223016),
("IXZXIIXZXI",0.0103288193223016),
("YYIIIIYZYI",-0.00346639184847533),
("XXIIIIYZYI",-0.00346639184847533),
("YYIIIIXZXI",-0.00346639184847533),
("XXIIIIXZXI",-0.00346639184847533),
("IIIYYYZZYI",0.00211113766859809),
("IIIXXYZZYI",0.00211113766859809),
("IIIYYXZZXI",0.00211113766859809),
("IIIXXXZZXI",0.00211113766859809),
("YZZZYYZZYI",-0.00776444118212153),
("XZZZXYZZYI",-0.00776444118212153),
("YZZZYXZZXI",-0.00776444118212153),
("XZZZXXZZXI",-0.00776444118212153),
("YZZYIYZZYI",0.00657574489918254),
("XZZXIYZZYI",0.00657574489918254),
("YZZYIXZZXI",0.00657574489918254),
("XZZXIXZZXI",0.00657574489918254),
("IIIIIYZZYI",0.0235574423958372),
("IIIIIXZZXI",0.0235574423958372),
("ZIIIIYZZYI",0.0108894077160944),
("ZIIIIXZZXI",0.0108894077160944),
("IZIIIYZZYI",-0.00035188935283895),
("IZIIIXZZXI",-0.00035188935283895),
("IIZIIYZZYI",-0.00035188935283895),
("IIZIIXZZXI",-0.00035188935283895),
("IIIZIYZZYI",-0.00901204279263803),
("IIIZIXZZXI",-0.00901204279263803),
("IIIIZYZZYI",0.0127339139792953),
("IIIIZXZZXI",0.0127339139792953),
("IIIIIYIZYI",-0.00381828120131428),
("IIIIIXIZXI",-0.00381828120131428),
("IIIIIYZIYI",-0.00381828120131428),
("IIIIIXZIXI",-0.00381828120131428),
("IYYIIIYYII",0.00421728487842275),
("IXXIIIYYII",0.00421728487842275),
("IYYIIIXXII",0.00421728487842275),
("IXXIIIXXII",0.00421728487842275),
("IIYZYYZYII",-0.00487974048419149),
("IIXZXYZYII",-0.00487974048419149),
("IIYZYXZXII",-0.00487974048419149),
("IIXZXXZXII",-0.00487974048419149),
("IIYYIYZYII",-0.00346639184847533),
("IIXXIYZYII",-0.00346639184847533),
("IIYYIXZXII",-0.00346639184847533),
("IIXXIXZXII",-0.00346639184847533),
("YZYIIYZYII",0.00486830254508752),
("XZXIIYZYII",0.00486830254508752),
("YZYIIXZXII",0.00486830254508752),
("XZXIIXZXII",0.00486830254508752),
("IYZZYYYIII",-0.00487974048419149),
("IXZZXYYIII",-0.00487974048419149),
("IYZZYXXIII",-0.00487974048419149),
("IXZZXXXIII",-0.00487974048419149),
("IYZYIYYIII",-0.00346639184847533),
("IXZXIYYIII",-0.00346639184847533),
("IYZYIXXIII",-0.00346639184847533),
("IXZXIXXIII",-0.00346639184847533),
("YYIIIYYIII",0.00486830254508752),
("XXIIIYYIII",0.00486830254508752),
("YYIIIXXIII",0.00486830254508752),
("XXIIIXXIII",0.00486830254508752),
("IIIYYIIIII",-0.00491756976241806),
("IIIXXIIIII",-0.00491756976241806),
("ZIIYYIIIII",0.00277574622690495),
("ZIIXXIIIII",0.00277574622690495),
("IZIYYIIIII",0.00362024875588371),
("IZIXXIIIII",0.00362024875588371),
("IIZYYIIIII",0.00362024875588371),
("IIZXXIIIII",0.00362024875588371),
("YZZZYIIIII",-0.00594901997573428),
("XZZZXIIIII",-0.00594901997573428),
("YIZZYIIIII",-0.00214985764886508),
("XIZZXIIIII",-0.00214985764886508),
("YZIZYIIIII",-0.00214985764886508),
("XZIZXIIIII",-0.00214985764886508),
("YZZIYIIIII",0.00447907456818256),
("XZZIXIIIII",0.00447907456818256),
("YZZYIIIIII",0.0235574423958372),
("XZZXIIIIII",0.0235574423958372),
("YIZYIIIIII",-0.00381828120131428),
("XIZXIIIIII",-0.00381828120131428),
("YZIYIIIIII",-0.00381828120131428),
("XZIXIIIIII",-0.00381828120131428),
("IIIIIIIIII",1.07092746636567),
("ZIIIIIIIII",-0.577292099065437),
("IZIIIIIIII",-0.424481753172713),
("ZZIIIIIIII",0.0624551252313693),
("IIZIIIIIII",-0.424481753172713),
("ZIZIIIIIII",0.0624551252313693),
("IZZIIIIIII",0.065584523154584),
("IIIZIIIIII",-0.389917764741521),
("ZIIZIIIIII",0.0539298607735884),
("IZIZIIIIII",0.0602255013995459),
("IIZZIIIIII",0.0602255013995459),
("YZZYZIIIII",0.00436055255503048),
("XZZXZIIIII",0.00436055255503048),
("IIIIZIIIII",-0.301015321589479),
("ZIIIZIIIII",0.0836012196724618),
("IZIIZIIIII",0.062788763434712),
("IIZIZIIIII",0.062788763434712),
("IIIZZIIIII",0.0536214107226148),
("IIIYYZIIII",0.0105401874090264),
("IIIXXZIIII",0.0105401874090264),
("YZZZYZIIII",-0.0351167704024114),
("XZZZXZIIII",-0.0351167704024114),
("YZZYIZIIII",0.0108894077160944),
("XZZXIZIIII",0.0108894077160944),
("IIIIIZIIII",-0.577292099065437),
("ZIIIIZIIII",0.114091635010207),
("IZIIIZIIII",0.0673234277764568),
("IIZIIZIIII",0.0673234277764568),
("IIIZIZIIII",0.0605056056727709),
("IIIIZZIIII",0.114339546849775),
("IIIYYIZIII",-0.00118228323247258),
("IIIXXIZIII",-0.00118228323247258),
("YZZZYIZIII",0.00272988283532641),
("XZZZXIZIII",0.00272988283532641),
("YZZYIIZIII",-0.00035188935283895),
("XZZXIIZIII",-0.00035188935283895),
("IIIIIIZIII",-0.424481753172713),
("ZIIIIIZIII",0.0673234277764568),
("IZIIIIZIII",0.0782363777898523),
("IIZIIIZIII",0.0698018080330068),
("IIIZIIZIII",0.0705543207218475),
("IIIIZIZIII",0.0687855242844466),
("IIIIIZZIII",0.0624551252313693),
("IIIYYIIZII",-0.00118228323247258),
("IIIXXIIZII",-0.00118228323247258),
("YZZZYIIZII",0.00272988283532641),
("XZZZXIIZII",0.00272988283532641),
("YZZYIIIZII",-0.00035188935283895),
("XZZXIIIZII",-0.00035188935283895),
("IIIIIIIZII",-0.424481753172713),
("ZIIIIIIZII",0.0673234277764568),
("IZIIIIIZII",0.0698018080330068),
("IIZIIIIZII",0.0782363777898523),
("IIIZIIIZII",0.0705543207218475),
("IIIIZIIZII",0.0687855242844466),
("IIIIIZIZII",0.0624551252313693),
("IIIIIIZZII",0.065584523154584),
("IIIYYIIIZI",-0.00154067008970742),
("IIIXXIIIZI",-0.00154067008970742),
("YZZZYIIIZI",0.00236793689958447),
("XZZZXIIIZI",0.00236793689958447),
("YZZYIIIIZI",-0.00901204279263803),
("XZZXIIIIZI",-0.00901204279263803),
("IIIIIIIIZI",-0.389917764741521),
("ZIIIIIIIZI",0.0605056056727709),
("IZIIIIIIZI",0.0705543207218475),
("IIZIIIIIZI",0.0705543207218475),
("IIIZIIIIZI",0.0847039180223953),
("IIIIZIIIZI",0.0566560675528197),
("IIIIIZIIZI",0.0539298607735884),
("IIIIIIZIZI",0.0602255013995459),
("IIIIIIIZZI",0.0602255013995459),
("IIIIIYZZYZ",0.00436055255503048),
("IIIIIXZZXZ",0.00436055255503048),
("IIIYYIIIIZ",0.0117336239120741),
("IIIXXIIIIZ",0.0117336239120741),
("YZZZYIIIIZ",-0.0330587285877558),
("XZZZXIIIIZ",-0.0330587285877558),
("YZZYIIIIIZ",0.0127339139792953),
("XZZXIIIIIZ",0.0127339139792953),
("IIIIIIIIIZ",-0.301015321589479),
("ZIIIIIIIIZ",0.114339546849775),
("IZIIIIIIIZ",0.0687855242844466),
("IIZIIIIIIZ",0.0687855242844466),
("IIIZIIIIIZ",0.0566560675528197),
("IIIIZIIIIZ",0.123570872248984),
("IIIIIZIIIZ",0.0836012196724618),
("IIIIIIZIIZ",0.062788763434712),
("IIIIIIIZIZ",0.062788763434712),
("IIIIIIIIZZ",0.0536214107226148)]


from classiq import ModelDesigner
from classiq.interface.chemistry.operator import PauliOperator
from classiq.interface.generator.suzuki_trotter import SuzukiTrotter, SuzukiParameters

model_designer = ModelDesigner()
trotter_params = SuzukiTrotter(
pauli_operator=PauliOperator(pauli_list=LiH),
evolution_coefficient=1,
suzuki_parameters=SuzukiParameters(order=1, repetitions=1),
)

model_designer.SuzukiTrotter(params=trotter_params)
result = model_designer.synthesize()
result.show_interactive()


Using Classiq's Python SDK - though an equivalent circuit can be designed using the Classiq extension in Visual Studio Code - we first specify that we are designing a Suzuki Trotter circuit. We import the Pauli string of the lithium hydride molecule and end the code with a few specifications for the Suzuki Trotter function. We specify the evolution coefficient, 1, and the desired order and repetition for our Suzuki Trotter function. We chose a single repetition because choosing to have more repetitions would yield a more precise but larger quantum simulation circuit.

That’s all! The interactive circuit, shown partially below, is available here and was generated using Classiq version 0.14.2. The circuit uses ten qubits, and has a depth of 1057.

To see how this compares to the solutions provided by competitors over the month-long competition, see here.

Beyond Lithium Hydride

Classiq’s customers can employ the same approach to simulate more complex molecules. For instance, below is the code to both generate the Pauli string for and simulate an H2O molecule.


from classiq import ModelDesigner
from classiq.interface.generator.model.constraints import OptimizationParameter
from classiq.interface.chemistry.ground_state_problem import GroundStateProblem
from classiq.interface.chemistry.molecule import Molecule
from classiq.interface.chemistry.operator import PauliOperator
from classiq.interface.generator.suzuki_trotter import SuzukiTrotter, SuzukiParameters

molecule_H2O = Molecule(
atoms=[("O", (0.0, 0.0, 0.0)), ("H", (0, 0.586, 0.757)), ("H", (0, 0.586, -0.757))]
)

gs_problem = GroundStateProblem(
molecule=molecule_H2O,
basis="sto3g",
mapping="jordan_wigner",
z2_symmetries=True,
freeze_core=True,
)

hamiltonian = gs_problem.generate_hamiltonian()

model_designer = ModelDesigner()
trotter_params = SuzukiTrotter(
pauli_operator=PauliOperator(pauli_list=hamiltonian.pauli_list),
evolution_coefficient=1,
suzuki_parameters=SuzukiParameters(order=1, repetitions=1),
use_naive_evolution=False,
)

model_designer.SuzukiTrotter(params=trotter_params)
result = model_designer.synthesize()
result.show_interactive()


And here is the resulting interactive circuit of depth 2120 using only 9 qubits.

Classiq has packaged the domain expertise of dozens of its scientists and quantum software engineers into the software platform. The result: a system that can automatically generate efficient quantum circuits for complex problems, making it faster and easier than ever to solve real-life problems with quantum computing. When the circuits are of manageable size, Classiq creates solutions that are on par with the best manually-created circuits. When the circuits are larger than those a human can reasonably create, Classiq allows you to progress farther because of its powerful capabilities.

With Classiq, there is no need to work at the gate level. Instead, Classiq customers work at a higher level, specifying the desired functionality of the circuit and the applicable constraints, and allow the Classiq platform to find the right optimized implementation out of billions of options in a vast design space.

Schedule a live demonstration of the Classiq platform to see it in action, or contact us to learn how you can create industry-leading quantum circuits in minutes.

This note demonstrates how to use the Classiq platform to solve the Hamiltonian Simulation problem that was part of our recent coding competition. We then demonstrate a more complex example - simulating an H2O molecule.

Introduction

Chemical simulation is one of the most exciting applications for quantum computers. When precise simulations of electron-electron interactions are necessary, it is sometimes possible to use a classical computer, but classical computers struggle to simulate more complex molecular interactions. It is best to simulate these particle interactions at the quantum level, and an excellent way to do this is with a quantum computer.

The ability to accurately simulate molecular interactions will have extensive applications. When used for drug discovery, it will allow for the rapid development of vaccines and new cures for diseases. In materials research, we can hope to discover materials with higher strength-to-weight ratios and environmentally-friendly building materials.

The Lithium Hydride Hamiltonian Simulation Problem

In our recent coding competition, we asked contestants to generate a circuit, using no more than ten qubits, that approximates the unitary e−iH where H is the qubit hamiltonian of a LiH (lithium hydride) molecule. The LiH Hamiltonian is composed of 276 Pauli strings and can be found here. The approximation error should be less than 0.1, and the circuit should be composed only of the CX and single-qubit gates.

Coding with Classiq

To solve this problem with Classiq, we use the Suzuki Trotter method, one of the most efficient ways to simulate Hamiltonians and generate quantum simulation circuits. Creating this circuit is straightforward. We specify the desired function of the circuit, and the platform generates an efficient quantum circuit. Here is the code:


LiH = [("IIIYYIIIYY",0.00303465683020485),
("IIIXXIIIYY",0.00303465683020485),
("IIIYYIIIXX",0.00303465683020485),
("IIIXXIIIXX",0.00303465683020485),
("YZZZYIIIYY",-0.00837336142426481),
("XZZZXIIIYY",-0.00837336142426481),
("YZZZYIIIXX",-0.00837336142426481),
("XZZZXIIIXX",-0.00837336142426481),
("YZZYIIIIYY",0.00211113766859809),
("XZZXIIIIYY",0.00211113766859809),
("YZZYIIIIXX",0.00211113766859809),
("XZZXIIIIXX",0.00211113766859809),
("IIIIIIIIYY",-0.00491756976241806),
("IIIIIIIIXX",-0.00491756976241806),
("ZIIIIIIIYY",0.0105401874090264),
("ZIIIIIIIXX",0.0105401874090264),
("IZIIIIIIYY",-0.00118228323247258),
("IZIIIIIIXX",-0.00118228323247258),
("IIZIIIIIYY",-0.00118228323247258),
("IIZIIIIIXX",-0.00118228323247258),
("IIIZIIIIYY",-0.00154067008970742),
("IIIZIIIIXX",-0.00154067008970742),
("IIIIZIIIYY",0.0117336239120741),
("IIIIZIIIXX",0.0117336239120741),
("IIIIIZIIYY",0.00277574622690495),
("IIIIIZIIXX",0.00277574622690495),
("IIIIIIZIYY",0.00362024875588371),
("IIIIIIZIXX",0.00362024875588371),
("IIIIIIIZYY",0.00362024875588371),
("IIIIIIIZXX",0.00362024875588371),
("IIYZYIIYZY",0.00599676084973456),
("IIXZXIIYZY",0.00599676084973456),
("IIYZYIIXZX",0.00599676084973456),
("IIXZXIIXZX",0.00599676084973456),
("IIYYIIIYZY",0.00480253198835629),
("IIXXIIIYZY",0.00480253198835629),
("IIYYIIIXZX",0.00480253198835629),
("IIXXIIIXZX",0.00480253198835629),
("YZYIIIIYZY",-0.00487974048419149),
("XZXIIIIYZY",-0.00487974048419149),
("YZYIIIIXZX",-0.00487974048419149),
("XZXIIIIXZX",-0.00487974048419149),
("IYZZYIYZZY",0.00599676084973456),
("IXZZXIYZZY",0.00599676084973456),
("IYZZYIXZZX",0.00599676084973456),
("IXZZXIXZZX",0.00599676084973456),
("IYZYIIYZZY",0.00480253198835629),
("IXZXIIYZZY",0.00480253198835629),
("IYZYIIXZZX",0.00480253198835629),
("IXZXIIXZZX",0.00480253198835629),
("YYIIIIYZZY",-0.00487974048419149),
("XXIIIIYZZY",-0.00487974048419149),
("YYIIIIXZZX",-0.00487974048419149),
("XXIIIIXZZX",-0.00487974048419149),
("IIIYYYZZZY",-0.00837336142426481),
("IIIXXYZZZY",-0.00837336142426481),
("IIIYYXZZZX",-0.00837336142426481),
("IIIXXXZZZX",-0.00837336142426481),
("YZZZYYZZZY",0.0307383271773138),
("XZZZXYZZZY",0.0307383271773138),
("YZZZYXZZZX",0.0307383271773138),
("XZZZXXZZZX",0.0307383271773138),
("YZZYIYZZZY",-0.00776444118212153),
("XZZXIYZZZY",-0.00776444118212153),
("YZZYIXZZZX",-0.00776444118212153),
("XZZXIXZZZX",-0.00776444118212153),
("IIIIIYZZZY",-0.00594901997573424),
("IIIIIXZZZX",-0.00594901997573424),
("ZIIIIYZZZY",-0.0351167704024114),
("ZIIIIXZZZX",-0.0351167704024114),
("IZIIIYZZZY",0.00272988283532641),
("IZIIIXZZZX",0.00272988283532641),
("IIZIIYZZZY",0.00272988283532641),
("IIZIIXZZZX",0.00272988283532641),
("IIIZIYZZZY",0.00236793689958447),
("IIIZIXZZZX",0.00236793689958447),
("IIIIZYZZZY",-0.0330587285877558),
("IIIIZXZZZX",-0.0330587285877558),
("IIIIIYIZZY",-0.00214985764886508),
("IIIIIXIZZX",-0.00214985764886508),
("IIIIIYZIZY",-0.00214985764886508),
("IIIIIXZIZX",-0.00214985764886508),
("IIIIIYZZIY",0.00447907456818256),
("IIIIIXZZIX",0.00447907456818256),
("IIYZYIIYYI",0.00480253198835629),
("IIXZXIIYYI",0.00480253198835629),
("IIYZYIIXXI",0.00480253198835629),
("IIXZXIIXXI",0.00480253198835629),
("IIYYIIIYYI",0.0103288193223016),
("IIXXIIIYYI",0.0103288193223016),
("IIYYIIIXXI",0.0103288193223016),
("IIXXIIIXXI",0.0103288193223016),
("YZYIIIIYYI",-0.00346639184847533),
("XZXIIIIYYI",-0.00346639184847533),
("YZYIIIIXXI",-0.00346639184847533),
("XZXIIIIXXI",-0.00346639184847533),
("IYZZYIYZYI",0.00480253198835629),
("IXZZXIYZYI",0.00480253198835629),
("IYZZYIXZXI",0.00480253198835629),
("IXZZXIXZXI",0.00480253198835629),
("IYZYIIYZYI",0.0103288193223016),
("IXZXIIYZYI",0.0103288193223016),
("IYZYIIXZXI",0.0103288193223016),
("IXZXIIXZXI",0.0103288193223016),
("YYIIIIYZYI",-0.00346639184847533),
("XXIIIIYZYI",-0.00346639184847533),
("YYIIIIXZXI",-0.00346639184847533),
("XXIIIIXZXI",-0.00346639184847533),
("IIIYYYZZYI",0.00211113766859809),
("IIIXXYZZYI",0.00211113766859809),
("IIIYYXZZXI",0.00211113766859809),
("IIIXXXZZXI",0.00211113766859809),
("YZZZYYZZYI",-0.00776444118212153),
("XZZZXYZZYI",-0.00776444118212153),
("YZZZYXZZXI",-0.00776444118212153),
("XZZZXXZZXI",-0.00776444118212153),
("YZZYIYZZYI",0.00657574489918254),
("XZZXIYZZYI",0.00657574489918254),
("YZZYIXZZXI",0.00657574489918254),
("XZZXIXZZXI",0.00657574489918254),
("IIIIIYZZYI",0.0235574423958372),
("IIIIIXZZXI",0.0235574423958372),
("ZIIIIYZZYI",0.0108894077160944),
("ZIIIIXZZXI",0.0108894077160944),
("IZIIIYZZYI",-0.00035188935283895),
("IZIIIXZZXI",-0.00035188935283895),
("IIZIIYZZYI",-0.00035188935283895),
("IIZIIXZZXI",-0.00035188935283895),
("IIIZIYZZYI",-0.00901204279263803),
("IIIZIXZZXI",-0.00901204279263803),
("IIIIZYZZYI",0.0127339139792953),
("IIIIZXZZXI",0.0127339139792953),
("IIIIIYIZYI",-0.00381828120131428),
("IIIIIXIZXI",-0.00381828120131428),
("IIIIIYZIYI",-0.00381828120131428),
("IIIIIXZIXI",-0.00381828120131428),
("IYYIIIYYII",0.00421728487842275),
("IXXIIIYYII",0.00421728487842275),
("IYYIIIXXII",0.00421728487842275),
("IXXIIIXXII",0.00421728487842275),
("IIYZYYZYII",-0.00487974048419149),
("IIXZXYZYII",-0.00487974048419149),
("IIYZYXZXII",-0.00487974048419149),
("IIXZXXZXII",-0.00487974048419149),
("IIYYIYZYII",-0.00346639184847533),
("IIXXIYZYII",-0.00346639184847533),
("IIYYIXZXII",-0.00346639184847533),
("IIXXIXZXII",-0.00346639184847533),
("YZYIIYZYII",0.00486830254508752),
("XZXIIYZYII",0.00486830254508752),
("YZYIIXZXII",0.00486830254508752),
("XZXIIXZXII",0.00486830254508752),
("IYZZYYYIII",-0.00487974048419149),
("IXZZXYYIII",-0.00487974048419149),
("IYZZYXXIII",-0.00487974048419149),
("IXZZXXXIII",-0.00487974048419149),
("IYZYIYYIII",-0.00346639184847533),
("IXZXIYYIII",-0.00346639184847533),
("IYZYIXXIII",-0.00346639184847533),
("IXZXIXXIII",-0.00346639184847533),
("YYIIIYYIII",0.00486830254508752),
("XXIIIYYIII",0.00486830254508752),
("YYIIIXXIII",0.00486830254508752),
("XXIIIXXIII",0.00486830254508752),
("IIIYYIIIII",-0.00491756976241806),
("IIIXXIIIII",-0.00491756976241806),
("ZIIYYIIIII",0.00277574622690495),
("ZIIXXIIIII",0.00277574622690495),
("IZIYYIIIII",0.00362024875588371),
("IZIXXIIIII",0.00362024875588371),
("IIZYYIIIII",0.00362024875588371),
("IIZXXIIIII",0.00362024875588371),
("YZZZYIIIII",-0.00594901997573428),
("XZZZXIIIII",-0.00594901997573428),
("YIZZYIIIII",-0.00214985764886508),
("XIZZXIIIII",-0.00214985764886508),
("YZIZYIIIII",-0.00214985764886508),
("XZIZXIIIII",-0.00214985764886508),
("YZZIYIIIII",0.00447907456818256),
("XZZIXIIIII",0.00447907456818256),
("YZZYIIIIII",0.0235574423958372),
("XZZXIIIIII",0.0235574423958372),
("YIZYIIIIII",-0.00381828120131428),
("XIZXIIIIII",-0.00381828120131428),
("YZIYIIIIII",-0.00381828120131428),
("XZIXIIIIII",-0.00381828120131428),
("IIIIIIIIII",1.07092746636567),
("ZIIIIIIIII",-0.577292099065437),
("IZIIIIIIII",-0.424481753172713),
("ZZIIIIIIII",0.0624551252313693),
("IIZIIIIIII",-0.424481753172713),
("ZIZIIIIIII",0.0624551252313693),
("IZZIIIIIII",0.065584523154584),
("IIIZIIIIII",-0.389917764741521),
("ZIIZIIIIII",0.0539298607735884),
("IZIZIIIIII",0.0602255013995459),
("IIZZIIIIII",0.0602255013995459),
("YZZYZIIIII",0.00436055255503048),
("XZZXZIIIII",0.00436055255503048),
("IIIIZIIIII",-0.301015321589479),
("ZIIIZIIIII",0.0836012196724618),
("IZIIZIIIII",0.062788763434712),
("IIZIZIIIII",0.062788763434712),
("IIIZZIIIII",0.0536214107226148),
("IIIYYZIIII",0.0105401874090264),
("IIIXXZIIII",0.0105401874090264),
("YZZZYZIIII",-0.0351167704024114),
("XZZZXZIIII",-0.0351167704024114),
("YZZYIZIIII",0.0108894077160944),
("XZZXIZIIII",0.0108894077160944),
("IIIIIZIIII",-0.577292099065437),
("ZIIIIZIIII",0.114091635010207),
("IZIIIZIIII",0.0673234277764568),
("IIZIIZIIII",0.0673234277764568),
("IIIZIZIIII",0.0605056056727709),
("IIIIZZIIII",0.114339546849775),
("IIIYYIZIII",-0.00118228323247258),
("IIIXXIZIII",-0.00118228323247258),
("YZZZYIZIII",0.00272988283532641),
("XZZZXIZIII",0.00272988283532641),
("YZZYIIZIII",-0.00035188935283895),
("XZZXIIZIII",-0.00035188935283895),
("IIIIIIZIII",-0.424481753172713),
("ZIIIIIZIII",0.0673234277764568),
("IZIIIIZIII",0.0782363777898523),
("IIZIIIZIII",0.0698018080330068),
("IIIZIIZIII",0.0705543207218475),
("IIIIZIZIII",0.0687855242844466),
("IIIIIZZIII",0.0624551252313693),
("IIIYYIIZII",-0.00118228323247258),
("IIIXXIIZII",-0.00118228323247258),
("YZZZYIIZII",0.00272988283532641),
("XZZZXIIZII",0.00272988283532641),
("YZZYIIIZII",-0.00035188935283895),
("XZZXIIIZII",-0.00035188935283895),
("IIIIIIIZII",-0.424481753172713),
("ZIIIIIIZII",0.0673234277764568),
("IZIIIIIZII",0.0698018080330068),
("IIZIIIIZII",0.0782363777898523),
("IIIZIIIZII",0.0705543207218475),
("IIIIZIIZII",0.0687855242844466),
("IIIIIZIZII",0.0624551252313693),
("IIIIIIZZII",0.065584523154584),
("IIIYYIIIZI",-0.00154067008970742),
("IIIXXIIIZI",-0.00154067008970742),
("YZZZYIIIZI",0.00236793689958447),
("XZZZXIIIZI",0.00236793689958447),
("YZZYIIIIZI",-0.00901204279263803),
("XZZXIIIIZI",-0.00901204279263803),
("IIIIIIIIZI",-0.389917764741521),
("ZIIIIIIIZI",0.0605056056727709),
("IZIIIIIIZI",0.0705543207218475),
("IIZIIIIIZI",0.0705543207218475),
("IIIZIIIIZI",0.0847039180223953),
("IIIIZIIIZI",0.0566560675528197),
("IIIIIZIIZI",0.0539298607735884),
("IIIIIIZIZI",0.0602255013995459),
("IIIIIIIZZI",0.0602255013995459),
("IIIIIYZZYZ",0.00436055255503048),
("IIIIIXZZXZ",0.00436055255503048),
("IIIYYIIIIZ",0.0117336239120741),
("IIIXXIIIIZ",0.0117336239120741),
("YZZZYIIIIZ",-0.0330587285877558),
("XZZZXIIIIZ",-0.0330587285877558),
("YZZYIIIIIZ",0.0127339139792953),
("XZZXIIIIIZ",0.0127339139792953),
("IIIIIIIIIZ",-0.301015321589479),
("ZIIIIIIIIZ",0.114339546849775),
("IZIIIIIIIZ",0.0687855242844466),
("IIZIIIIIIZ",0.0687855242844466),
("IIIZIIIIIZ",0.0566560675528197),
("IIIIZIIIIZ",0.123570872248984),
("IIIIIZIIIZ",0.0836012196724618),
("IIIIIIZIIZ",0.062788763434712),
("IIIIIIIZIZ",0.062788763434712),
("IIIIIIIIZZ",0.0536214107226148)]


from classiq import ModelDesigner
from classiq.interface.chemistry.operator import PauliOperator
from classiq.interface.generator.suzuki_trotter import SuzukiTrotter, SuzukiParameters

model_designer = ModelDesigner()
trotter_params = SuzukiTrotter(
pauli_operator=PauliOperator(pauli_list=LiH),
evolution_coefficient=1,
suzuki_parameters=SuzukiParameters(order=1, repetitions=1),
)

model_designer.SuzukiTrotter(params=trotter_params)
result = model_designer.synthesize()
result.show_interactive()


Using Classiq's Python SDK - though an equivalent circuit can be designed using the Classiq extension in Visual Studio Code - we first specify that we are designing a Suzuki Trotter circuit. We import the Pauli string of the lithium hydride molecule and end the code with a few specifications for the Suzuki Trotter function. We specify the evolution coefficient, 1, and the desired order and repetition for our Suzuki Trotter function. We chose a single repetition because choosing to have more repetitions would yield a more precise but larger quantum simulation circuit.

That’s all! The interactive circuit, shown partially below, is available here and was generated using Classiq version 0.14.2. The circuit uses ten qubits, and has a depth of 1057.

To see how this compares to the solutions provided by competitors over the month-long competition, see here.

Beyond Lithium Hydride

Classiq’s customers can employ the same approach to simulate more complex molecules. For instance, below is the code to both generate the Pauli string for and simulate an H2O molecule.


from classiq import ModelDesigner
from classiq.interface.generator.model.constraints import OptimizationParameter
from classiq.interface.chemistry.ground_state_problem import GroundStateProblem
from classiq.interface.chemistry.molecule import Molecule
from classiq.interface.chemistry.operator import PauliOperator
from classiq.interface.generator.suzuki_trotter import SuzukiTrotter, SuzukiParameters

molecule_H2O = Molecule(
atoms=[("O", (0.0, 0.0, 0.0)), ("H", (0, 0.586, 0.757)), ("H", (0, 0.586, -0.757))]
)

gs_problem = GroundStateProblem(
molecule=molecule_H2O,
basis="sto3g",
mapping="jordan_wigner",
z2_symmetries=True,
freeze_core=True,
)

hamiltonian = gs_problem.generate_hamiltonian()

model_designer = ModelDesigner()
trotter_params = SuzukiTrotter(
pauli_operator=PauliOperator(pauli_list=hamiltonian.pauli_list),
evolution_coefficient=1,
suzuki_parameters=SuzukiParameters(order=1, repetitions=1),
use_naive_evolution=False,
)

model_designer.SuzukiTrotter(params=trotter_params)
result = model_designer.synthesize()
result.show_interactive()


And here is the resulting interactive circuit of depth 2120 using only 9 qubits.

Classiq has packaged the domain expertise of dozens of its scientists and quantum software engineers into the software platform. The result: a system that can automatically generate efficient quantum circuits for complex problems, making it faster and easier than ever to solve real-life problems with quantum computing. When the circuits are of manageable size, Classiq creates solutions that are on par with the best manually-created circuits. When the circuits are larger than those a human can reasonably create, Classiq allows you to progress farther because of its powerful capabilities.

With Classiq, there is no need to work at the gate level. Instead, Classiq customers work at a higher level, specifying the desired functionality of the circuit and the applicable constraints, and allow the Classiq platform to find the right optimized implementation out of billions of options in a vast design space.

Schedule a live demonstration of the Classiq platform to see it in action, or contact us to learn how you can create industry-leading quantum circuits in minutes.