Skip to content

Added GenIsing.py#29

Closed
prasanthcakewalk wants to merge 1 commit intodanlkv:qubo_simulationsfrom
prasanthcakewalk:general_ising
Closed

Added GenIsing.py#29
prasanthcakewalk wants to merge 1 commit intodanlkv:qubo_simulationsfrom
prasanthcakewalk:general_ising

Conversation

@prasanthcakewalk
Copy link

This PR extends QTensor to perform QAOA for general Ising Hamiltonians, which can contain constant, linear, and quadratic terms.

The Ising Hamiltonian is to be encoded as a networkx graph.
For a Hamiltonian H = \sum_{i ≠ j} (A_ij/2) s_i s_j + \sum_i B_i s_i + C

  1. The nodes of the graph correspond to the variables s_i = -1 or 1.
  2. A_ij is given by the 'weight' attribute of the edge between i and j. If an edge is absent, the corresponding A_ij is assumed to be 0.
  3. B_i is given by the 'weight' attribute of the node i. If the 'weight' attribute is absent for a node, the corresponding B_i is assumed to be 0.
  4. C is specified by a graph attribute called 'offset'.

Also included is a utility to convent a docplex qubo model (for an objective function defined on binary variables x_i = 0 or 1) into a networkx graph as-per the specifications above.

@danlkv danlkv changed the base branch from master to qubo_simulations July 27, 2021 19:42
@danlkv danlkv changed the base branch from qubo_simulations to master July 27, 2021 19:51
@danlkv danlkv changed the base branch from master to qubo_simulations July 27, 2021 19:51
@danlkv
Copy link
Owner

danlkv commented Jul 27, 2021

Hi @prasanthcakewalk, thanks for the contribution! I added a qubo_simulations branch, which is a dev with merged changes from master.

TODO, as discussed:

  1. Add tests, compare to qiskit or a well-known result
  2. Better handling of single-node energy

Problems to think about:

  1. pynauty fails to install. @prasanthcakewalk Could you provide more info on the issue? @rsln-s did you face any problems with pynauty python package? Maybe we should consider removing from setup.py dependencies and make it an optional dependency.
  2. A lot of subclasses to support different builders and composers. Consider changing the architecture.

@danlkv
Copy link
Owner

danlkv commented Aug 24, 2021

Closing as outdated, see #34

@danlkv danlkv closed this Aug 24, 2021
@prasanthcakewalk prasanthcakewalk deleted the general_ising branch August 24, 2021 19:22
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