-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChoiceMC_Example.py
20 lines (18 loc) · 956 Bytes
/
ChoiceMC_Example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Sample code for the ChoiceMC implementation
from ChoiceMC import ChoiceMC
PIMC = ChoiceMC(m_max=5, P=9, g=1.0, MC_steps=50000, N=2, PIGS=True, Nskip=100, Nequilibrate=100, V0=5.0, potentialField='transverse', T=0.25)
# Creating the probability density matrix for each rotor
PIMC.createFreeRhoMarx()
# Creating the probability density matrix for nearest neighbour interactions
PIMC.createRhoVij()
# Performing MC integration
PIMC.runMC(averagePotential = True, averageEnergy = True, orientationalCorrelations = True, initialState = 'random')
# Saving plots of the histograms
PIMC.plotHisto_total('left', 'middle', 'right', 'initial')
PIMC.plotHisto_N('PIMC', 'middle')
# Example of how to access class attributes
print('<E> = ', PIMC.E_MC)
# Calculating the properties by exact diagonalization, this can only be done for N=2
PIMC.runExactDiagonalization()
# Calculating the properties using the NMM method, this can only be done for N=2
PIMC.runNMM()