generated from evmckinney9/python-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
This issue focuses on two key enhancements to the TrotterGroup class:
- Implementing second-order Trotterization for continuous quantum operators.
- Adding an optional parameter to offload Trotterization calculations to Rust for performance optimization.
Background
-
First-Order Trotterization (current implementation):
$$e^{A+B} \approx \left(e^{A/N} e^{B/N}\right)^N$$ -
Second-Order Trotterization (proposed enhancement):
$$e^{A+B} \approx \left(e^{A/2N} e^{B/N} e^{A/2N}\right)^N$$ - Rust Integration: Previously implemented but lost in refactoring, it allows offloading intensive computations to Rust for performance optimization.
Proposed Changes
- Modify the
applymethod in theTrotterGroupclass to implement second-order Trotterization. - Add an optional parameter in
applymethod to choose between Python and Rust for Trotterization computation. - Ensure compatibility with existing data structures like
CPTPMap,Channel, andQobj. - Update dimensionality checks and error handling for second-order approximation.
Rust Code Reference
#[pyfunction]
fn apply_operators_in_place(
py: Python,
state: &PyArray2<Complex64>,
num_steps: usize,
operator_groups: Vec<Vec<&PyArray2<Complex64>>>,
) -> PyResult<PyObject> {Python-Rust Integration
- The Rust function
apply_operators_in_placeshould be callable from the Pythonapplymethod, with appropriate data structure conversion and error handling. - Test the integration thoroughly to ensure consistency in results between Python and Rust implementations.
Additional Resources
- Mathematical background: math-ph/0506007.
Testing
- Implement unit tests for the second-order Trotterization in Python.
- Test the Rust integration to verify its functionality and performance benefits.
- Validate the results against first-order approximation and theoretical expectations.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request