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

Fix for non-commutativity check in spin_op multiplication #2097

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

sacpis
Copy link
Collaborator

@sacpis sacpis commented Aug 16, 2024

Fixes #2092

Fix for non-commutativity check in spin_op multiplication

Test result

spin_op = (cudaq.spin.z(0) + cudaq.spin.z(1)) * cudaq.spin.x(0)
print(spin_op.to_matrix())

 (0,0)  (2,0)  (0,0)  (0,0)
 (0,0)  (0,0)  (0,0)  (0,0)
 (0,0)  (0,0)  (0,0)  (0,0)
 (0,0)  (0,0) (-2,0)  (0,0)

spin_op = cudaq.spin.x(0) * (cudaq.spin.z(0) + cudaq.spin.z(1))
print(spin_op.to_matrix())

 (0,0)  (2,0)  (0,0)  (0,0)
 (0,0)  (0,0)  (0,0)  (0,0)
 (0,0)  (0,0)  (0,0)  (0,0)
 (0,0)  (0,0) (-2,0)  (0,0)

cTest result

100% tests passed, 0 tests failed out of 644

Label Time Summary:
gpu_required    =  89.12 sec*proc (367 tests)

Total Test time (real) = 539.95 sec

@sacpis sacpis changed the title Changed phase calculation and corrected _phase result Fix for non-commutativity check in spin_op multiplication Aug 16, 2024
@sacpis sacpis marked this pull request as ready for review August 16, 2024 04:50
@sacpis sacpis requested review from bettinaheim and 1tnguyen August 16, 2024 04:51
@sacpis sacpis enabled auto-merge (squash) August 16, 2024 04:51
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Aug 16, 2024
@sacpis sacpis requested a review from bmhowe23 August 16, 2024 11:17
@sacpis sacpis disabled auto-merge August 16, 2024 18:53
@sacpis sacpis requested a review from anthony-santana August 19, 2024 15:49
@sacpis sacpis enabled auto-merge (squash) August 19, 2024 15:52
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Aug 19, 2024
@sacpis sacpis merged commit 479c223 into NVIDIA:main Aug 19, 2024
129 of 131 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2024
@bettinaheim bettinaheim added the no release notes Don't list this PR in the release notes label Nov 19, 2024
@bettinaheim bettinaheim added this to the release 0.9.0 milestone Nov 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no release notes Don't list this PR in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect spin op expression evaluation
4 participants