openjij.utils.graph_utils

openjij.utils.graph_utils#

Functions#

chimera_to_ind(r, c, z, L)

[summary]

qubo_to_ising(mat)

Inplace-convert numpy matrix from qubo to ising.

Module Contents#

openjij.utils.graph_utils.chimera_to_ind(r: int, c: int, z: int, L: int)[source]#

[summary]

Parameters:
  • r (int) – row index

  • c (int) – column index

  • z (int) – in-chimera index (must be from 0 to 7)

  • L (int) – height and width of chimera-units (total number of spins is L×L×8L \times L \times 8)

Raises:

ValueError – [description]

Returns:

corresponding Chimera index

Return type:

int

openjij.utils.graph_utils.qubo_to_ising(mat: ndarray)[source]#

Inplace-convert numpy matrix from qubo to ising.

Parameters:

mat (np.ndarray) – numpy matrix