Ising module
animated_system
Support class for animations
Source code in bubblebox/ising.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
isingbox
Source code in bubblebox/ising.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
__init__(N, kT, flipratio=0.1)
A 2D (N by N) Ising model
Arguments
N Lattice dimensions kT Boltsmann factor times the temperature flipratio The ratio of spins to flip at each iteration
Methods
reset(kT) reset the lattice to all spins aligned, and set kT energy_per_site() compute the energy per site
Example usage
I = ising(10, kT = 1.0) # an Ising lattice with 10x10 spins, kT = 1.0
I.advance() # do one Monte Carlo integration
I.evolve(10) # do 10 Monte Carlo integrations
energy = I.compute_energy() # compute energy
mangetization = I.compute_magnetization() # compute magnetization
energy, magnetization = I.sample(100, 1000) # collect 100 samples, separated by 1000 MC-iterations
Source code in bubblebox/ising.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
advance()
Do one Monte Carlo step
Source code in bubblebox/ising.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
compute_energy()
Compute total energy
Source code in bubblebox/ising.py
131 132 133 |
|
compute_magnetization()
Compute magnetization
Source code in bubblebox/ising.py
127 128 129 |
|
energy_env_torus()
Compute energy per site for torus PBC
Source code in bubblebox/ising.py
87 88 89 90 |
|
energy_per_site(Z)
Compute sitewise energy (returns a lattice)
Source code in bubblebox/ising.py
77 78 79 |
|
evolve(n_steps)
Do n_steps Monte Carlo steps
Source code in bubblebox/ising.py
121 122 123 124 125 |
|
log_uniform(n)
A logarithmic random distribution
Source code in bubblebox/ising.py
83 84 85 |
|
reset(kT)
Reset the system to a non-magnetized state ( |M| = 0 )
and set kT to the specified value
Source code in bubblebox/ising.py
63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
run(phase_color=False, n_steps_per_vis=100)
Run simulation interactively
Source code in bubblebox/ising.py
157 158 159 160 |
|
sample(n_samples, n_separations)
Collect n_samples separated by n_separations Monte Carlo steps
Returns energies_per_site, specific heat, absolute_magnetization_per_site
Source code in bubblebox/ising.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
update_env(signs, z_ind)
update energy environment with a change in Z[z_ind]
Source code in bubblebox/ising.py
92 93 94 95 96 97 98 |
|