Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ip: section 2 task 3 Hamiltonian Sys Dynamics #2

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

rockett-m
Copy link
Collaborator

Summary

This PR adds a class ExpectedResults to compute the expectation value of X_0 for a Trotterized Ising Hamiltonian evolution. The results are collected over multiple time steps and Trotter steps.

🚀 Changes Introduced
• Implements ExpectedResults class for structured execution.
• Computes expectation values using Trotterized evolution circuits.
• Measures all qubits before retrieving results.
• Compiles circuits once per step to reduce redundant computations.
• Ensures imaginary part of expectation value is minimal.

🛠️ Next Steps / Known Issues
• Performance Issue:
• Execution is slow, especially for large N and many Trotter steps.
• Possible optimizations:
• Reduce redundant circuit re-compilations.
• Investigate more efficient expectation value computation.
• Parallelize circuit execution if possible.
• Code Generalization:
• Currently designed for X_0 expectation only.
• Consider refactoring to allow flexible observables.

✅ How to Test
1. Run the script and verify expectation values are computed correctly.
2. Check that no imaginary parts exceed 1e-8.
3. Validate the output using print_results() and graph_results().

@rockett-m rockett-m merged commit 842f959 into lipet2k:main Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant