Skip to content

[Feature Request]: Enhance TrotterGroup.apply() with Second-Order Trotterization and Rust Integration #2

@evmckinney9

Description

@evmckinney9

Description

This issue focuses on two key enhancements to the TrotterGroup class:

  1. Implementing second-order Trotterization for continuous quantum operators.
  2. 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 apply method in the TrotterGroup class to implement second-order Trotterization.
  • Add an optional parameter in apply method to choose between Python and Rust for Trotterization computation.
  • Ensure compatibility with existing data structures like CPTPMap, Channel, and Qobj.
  • 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_place should be callable from the Python apply method, with appropriate data structure conversion and error handling.
  • Test the integration thoroughly to ensure consistency in results between Python and Rust implementations.

Additional Resources

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 request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions