-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update XY_mixer_hamiltonian with Additional mixer_qubit_conndectivity #313
Update XY_mixer_hamiltonian with Additional mixer_qubit_conndectivity #313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great! Thanks for implementing the cyclic version of the XY mixer hamiltonian.
The only comment I have is to update the test here.
Basically adding adding an extra "cyclic"
case to the following code:
for connectivity in connectivities:
# Define connectivity explicit indexing
if connectivity == "full":
terms_indices = list(itertools.combinations(range(n_qubits), 2))
input_coefficients = 2 * [1 for _ in range(len(terms_indices))]
mixer_type = "xy"
elif connectivity == "chain":
terms_indices = [(i, i + 1) for i in range(n_qubits - 1)]
input_coefficients = 2 * [1 for _ in range(len(terms_indices))]
mixer_type = "xy"
elif connectivity == "star":
terms_indices = [(0, i) for i in range(1, n_qubits)]
input_coefficients = 2 * [1 for _ in range(len(terms_indices))]
mixer_type = "xy"
else:
input_coefficients = [1 for _ in range(n_qubits)]
mixer_type = "x"
Let me know what you think of this!
Thank you for your feedback! I think adding the cyclic case to the test is a great idea. I will proceed with the following updates to the test code:
I'll make these changes and update the PR shortly. Please let me know if you have any additional suggestions or concerns. |
I have added the cyclic connectivity test cases as requested. Here are the test results:
All tests passed successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks great!
Thank you for implementing the cyclic version of the XY-mixer Hamiltonian
4f3721a
to
b457199
Compare
Description
This PR adds new mixer_qubit_connectivity to the
XY_mixer_hamiltonian
andget_mixer_hamiltonian
function.Checklist
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Add the "cyclic" case to the code in
test_utilities.py
.