Skip to content

Remove deepcopy in _visit_generic_gate_operation#180

Merged
TheGupta2012 merged 3 commits intomainfrom
remove-deepcopy
May 1, 2025
Merged

Remove deepcopy in _visit_generic_gate_operation#180
TheGupta2012 merged 3 commits intomainfrom
remove-deepcopy

Conversation

@TheGupta2012
Copy link
Copy Markdown
Member

@TheGupta2012 TheGupta2012 commented Apr 30, 2025

Reference : #962 | qBraid

Summary of changes

The change changes the deep copy of the operation and ctrls variables into a shallow copy, likely to improve performance and reduce unnecessary memory usage.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@TheGupta2012 TheGupta2012 merged commit e4ea76e into main May 1, 2025
@TheGupta2012
Copy link
Copy Markdown
Member Author

TheGupta2012 commented May 1, 2025

@bachase post this change can you test the ucc benchmark against the main branch of the repo?
I believe that the shallow copy.copy operation would be less expensive than the deepcopy but happy to see the test results and comment further.

@bachase
Copy link
Copy Markdown

bachase commented May 1, 2025

@TheGupta2012 a nice improvement!

The call stack starting from https://github.com/qBraid/qBraid/blob/7ac709340740e6703acb81cbee586112573d703b/qbraid/transpiler/conversions/qasm2/qasm2_to_cirq.py#L50 went from 13.67 seconds to 3.16 seconds.

@TheGupta2012 TheGupta2012 deleted the remove-deepcopy branch May 26, 2025 06:46
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.

3 participants