original_docstring: 
      Computes the change in energy by flipping each bit
  
      Inputs:
          - x : binary n x m matrix of spin states (value +1 or -1)
          - Jnm : magnetic coupling between neighbouring spins (typically +1 or -1)
          - H : magnetic field or potential on the spins
  
      Yields:
          - (change in energy, (i, j))
      
docstring: Computes the change in energy by flipping each bit
  Inputs:
  x : binary n x m matrix of spin states (value +1 or -1)
  Jnm : magnetic coupling between neighbouring spins (typically +1 or -1)
  H : magnetic field or potential on the spins
docstring_tokens: Computes the change in energy by flipping each bit Inputs : x : binary n x m matrix of spin states ( value + 1 or - 1 ) Jnm : magnetic coupling between neighbouring spins ( typically + 1 or - 1 ) H : magnetic field or potential on the spins
code: def ising_best_change(x, Jij, H=None):
      """
      Computes the change in energy by flipping each bit
  
      Inputs:
          - x : binary n x m matrix of spin states (value +1 or -1)
          - Jnm : magnetic coupling between neighbouring spins (typically +1 or -1)
          - H : magnetic field or potential on the spins
  
      Yields:
          - (change in energy, (i, j))
      """
      n, m = x.shape
      best_delta = 1e100
      for i in range(n):
          for j in range(m):
              delta_energy = compute_delta_energy(x, i, j, Jij, H)
              if delta_energy < best_delta:
                  best_pos = i, j
                  best_delta = delta_energy
      return best_delta, best_pos
code_tokens: def ising_best_change ( x , Jij , H = None ) : n , m = x . shape best_delta = 1e100 for i in range ( n ) : for j in range ( m ) : delta_energy = compute_delta_energy ( x , i , j , Jij , H ) if delta_energy < best_delta : best_pos = i , j best_delta = delta_energy return best_delta , best_pos
short_docstring: Computes the change in energy by flipping each bit
  Inputs:
   x : binary n x m matrix of spin states (value +1 or -1)
   Jnm : magnetic coupling between neighbouring spins (typically +1 or -1)
   H : magnetic field or potential on the spins
short_docstring_tokens: Computes the change in energy by flipping each bit Inputs : x : binary n x m matrix of spin states ( value + 1 or - 1 ) Jnm : magnetic coupling between neighbouring spins ( typically + 1 or - 1 ) H : magnetic field or potential on the spins
comment: """
      Computes the change in energy by flipping each bit
  
      Inputs:
          - x : binary n x m matrix of spin states (value +1 or -1)
          - Jnm : magnetic coupling between neighbouring spins (typically +1 or -1)
          - H : magnetic field or potential on the spins
  
      Yields:
          - (change in energy, (i, j))
      """