entropicalabs / openqaoa

Multi-backend SDK for quantum optimisation
MIT License
117 stars 58 forks source link

Update XY_mixer_hamiltonian with Additional mixer_qubit_conndectivity #313

Closed yoshioka1128 closed 1 month ago

yoshioka1128 commented 4 months ago

Description

This PR adds new mixer_qubit_connectivity to the XY_mixer_hamiltonian and get_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.

yoshioka1128 commented 4 months ago

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:

  1. Add the "cyclic" case to the connectivities list.
  2. Implement the necessary logic for the cyclic connectivity in the loop.

I'll make these changes and update the PR shortly. Please let me know if you have any additional suggestions or concerns.

yoshioka1128 commented 4 months ago

I have added the cyclic connectivity test cases as requested.

Here are the test results:

........................
Qubits in the specified Hamiltonian are remapped to [0]. Please specify the physical quantum register as a qubit layout argument in the backend.
Qubits in the specified Hamiltonian are remapped to [0, 1, 2]. Please specify the physical quantum register as a qubit layout argument in the backend.
...
----------------------------------------------------------------------
Ran 27 tests in 0.294s

OK

All tests passed successfully. The warnings about qubit remapping are not errors and do not affect the test results. Please let me know if there are any further changes or additional tests needed.