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

[Performance, Refactor] Operator multiplication without explicit identities #268

Merged
merged 16 commits into from
Aug 26, 2024

Conversation

jpmoutinho
Copy link
Collaborator

@jpmoutinho jpmoutinho commented Aug 22, 2024

Refactors the operator_product function that does not require explicit identity padding. Also refactors the apply_density_mat into a new apply_operator_dm without explicit identities. The logic of both is similar, and the logic of apply_operator_dm is very similar to apply_operator_permute, but keeping everything separate for now.

The reason not to use operator_product inside apply_operator_dm is to avoid permuting the qubits twice.

The new functions are similar in performance for small number of qubits. For 5 to 9 qubits they become a few times faster. For 12 qubits the speedup is already ~10x.

@jpmoutinho jpmoutinho added performance Performance improvements Refactor noise noisy simulation labels Aug 22, 2024
@jpmoutinho jpmoutinho self-assigned this Aug 22, 2024
@jpmoutinho
Copy link
Collaborator Author

Hey @EthanObadia finally got around to writing the apply_operator equivalent for density matrices without using explicit identity padding. If you have some time to check it out it would be great :)

@jpmoutinho jpmoutinho merged commit bde458d into main Aug 26, 2024
9 checks passed
@jpmoutinho jpmoutinho deleted the jm/noise_improv branch August 26, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noise noisy simulation performance Performance improvements Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants