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 num_qubits when add and multiply Hamiltonian #100

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Conversation

Jacomichi
Copy link
Collaborator

Change

Fixed a bug where the num_qubits information would disappear after the calculation, even though h = Hamiltonian(num_qubits=3).

Desciption

The __add__ and __mul__ of Hamiltonian now inherit the information before the operation.
In addition, when performing an operation on two Hamiltonians, the one with the larger num_qubits is selected to be inherited.

@Jacomichi Jacomichi merged commit fb72a13 into main Nov 14, 2024
6 checks passed
@Jacomichi Jacomichi deleted the fix/ham_num_qubits branch November 14, 2024 23:52
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.

2 participants