qBraid / qbraid-algorithms

Build hybrid quantum-classical algorithms with qBraid
GNU General Public License v3.0
6 stars 4 forks source link

feat(qrc): Implement Magnus expansion for simulating quantum dynamics #13

Closed babcockt18 closed 4 months ago

babcockt18 commented 4 months ago

This pull request introduces the following changes:

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.