MonteCarloAlgorithm.IsingHamiltonian

class MonteCarloAlgorithm.IsingHamiltonian(node_connections=[[()]], outside_affect=array([0.]))[source]
__init__(node_connections=[[()]], outside_affect=array([0.]))[source]

creates a hamiltonian :Parameters: * node_connections how the nodes connect to each other

  • outside_affect any influence outside the hamiltonian

Methods

__init__([node_connections, outside_affect])

creates a hamiltonian :Parameters: * node_connections how the nodes connect to each other * outside_affect any influence outside the hamiltonian

compute_average_values(config[, temperature])

compute the average energy of a hamiltonian :Parameters: * config a bitstring does not really matter what is inputed * temperature temperature

energy(config)

calculates the energy of the config :Parameters: config a bitstring

energy_change(config, flipped_index[, ...])

calculates delta energy given a bit flip :Parameters: * config origin config * flipped_index index of proposed bit to flip * old_energy energy state of the current config (not required input) * Returns * delta energy * -------

make_change(energy_change, temperature)

determines if a change to the bit string should be made :Parameters: * energy_change how much energy a flip would save/cost * temperature temperature

metropolis_sweep(config[, temperature])

runs a metropolis sweep on the bitstring :Parameters: * config input config * temperature temperature