This pull request introduces the following changes:
Add a new class MagnusExpansion in the qrc module for simulating quantum dynamics using the Magnus expansion method.
Implement methods in the MagnusExpansion class to compute the Magnus expansion terms up to the fourth order, calculate the time evolution operator, and simulate the dynamics of a quantum system.
Update the qrc module's __init__.py to include the MagnusExpansion class in the public API.
Add a new test file test_magnus_expansion.py in the tests/test_qbraid_algorithms/test_qrc/ directory to test the simulate_dynamics method of the MagnusExpansion class.
Include a simple test case in test_simulate_dynamics to verify the correctness of the simulated dynamics against the expected final state.
The Magnus expansion is a powerful method for approximating the time evolution operator of a quantum system governed by a time-dependent Hamiltonian. By implementing the Magnus expansion in the qrc module, users can now simulate the dynamics of quantum systems more accurately and efficiently.
This implementation computes the Magnus expansion terms up to the fourth order, providing a good balance between accuracy and computational complexity. The simulate_dynamics method allows users to specify the initial state, final time, and time step for the simulation.
The added test case ensures that the simulate_dynamics method produces the expected final state for a simple quantum system, verifying the correctness of the implementation.
These changes enhance the capabilities of the qrc module and provide users with a valuable tool for simulating quantum dynamics using the Magnus expansion method.
This pull request introduces the following changes:
MagnusExpansion
in theqrc
module for simulating quantum dynamics using the Magnus expansion method.MagnusExpansion
class to compute the Magnus expansion terms up to the fourth order, calculate the time evolution operator, and simulate the dynamics of a quantum system.qrc
module's__init__.py
to include theMagnusExpansion
class in the public API.test_magnus_expansion.py
in thetests/test_qbraid_algorithms/test_qrc/
directory to test thesimulate_dynamics
method of theMagnusExpansion
class.test_simulate_dynamics
to verify the correctness of the simulated dynamics against the expected final state.The Magnus expansion is a powerful method for approximating the time evolution operator of a quantum system governed by a time-dependent Hamiltonian. By implementing the Magnus expansion in the
qrc
module, users can now simulate the dynamics of quantum systems more accurately and efficiently.This implementation computes the Magnus expansion terms up to the fourth order, providing a good balance between accuracy and computational complexity. The
simulate_dynamics
method allows users to specify the initial state, final time, and time step for the simulation.The added test case ensures that the
simulate_dynamics
method produces the expected final state for a simple quantum system, verifying the correctness of the implementation.These changes enhance the capabilities of the
qrc
module and provide users with a valuable tool for simulating quantum dynamics using the Magnus expansion method.