class AnhDirect[source]

Bases: object

Direct solution of the Schroedinger equation

The Schroedinger equation for the 1D anharmonic potential is directly solved by a numerical method using sparse matrix algebra. Relevant parameters for the calculation are: the number of points (N) at which the L interval for the numerical integration is sampled, and the length L itself. The computation is performed by setting the boundary conditions as psi(-L/2)=psi(L/2)=0, so that if the distance L is not large enough compared to the length scale of the oscillator, a ‘particle in the box energy’ spectrum will arise to affect the computed oscillator energy levels.

The length parameter L is determined by the factor ‘fact’ which, by default, is set to 1; the interval for the integration is then [-fact*0.5, fact*0.5]

The default value for ‘fact’ proved to be suitable for low frequency vibrational modes. For higher frequency modes, a larger value of such parameter is generally required. The parameter can be modified by means of the set_fact method.

The default value for N in 4000. Use the method set_N to modify it.

The potential from the SCANMODE CRYSTAL calculation is fitted by a polinomial function of degree 4. Use the method set_deg to change such degree

compute(iv)[source]
diag(iv)[source]
extra()[source]
info()[source]
potential(iv)[source]
reset_direct()[source]
set_N(n)[source]
set_deg(deg)[source]
set_direct()[source]
set_fact(fact)[source]
H_matrix(iv)[source]
class anh_class[source]

Bases: object

check_partition(iv, temp, from_plot=False)[source]

Checks convergence of the partition function at a given temperature

Parameters:
  • iv – volume index (according to the list of volumes specified in the volumes.dat file)

  • temp – temperature (k)

compare(iv, mxl=10)[source]
computation(iv, direct=False)[source]
class data_class(dim)[source]

Bases: object

class data_flag[source]

Bases: object

diag_n(iv, n)[source]
direct_plot(iv, lev_list)[source]
energy_anh(iv)[source]
energy_func(qq, a, b, c, d)[source]
energy_quad(qq, a, b)[source]
extra_1(iv, n)[source]
extra_2(iv, n)[source]
extra_3(iv, n)[source]
extra_4(iv, n)[source]
frequencies(iv, mxl=5, spect=False)[source]
frequencies_compare(iv, mxl=5)[source]
gauss(f0, ff, sigma)[source]
helm(iv, temp)[source]

Computes the Helmholtz free energy (in hartree)

Parameters:
  • iv – volume index (according to the list of volumes specified in the volumes.dat file)

  • temp – temperature (K)

helm_fit(temp=300, direct=False)[source]

Main function of the program: the produces the final result of the F(V,T) surface.

Parameters:

temp – temperature (in K) used in the test for convergence of the partition function (default: 300 K)

helm_func(data, *par)[source]
helm_harm(freq, temp, prt=False)[source]

Computation of the Helmholtz (F) free energy for an harmonic mode having a given frequency, at a given temperature.

Parameters:
  • freq – frequency (cm^-1)

  • temp – temperature (K)

  • prt – if True, the value of F is printed, otherwise the value of F is returned

load_files()[source]

Loads data files and file names of the SCAN data

lorentz(f0, ff, fwhm)[source]
main()[source]
partition(iv, temp, nl=10)[source]

Computes the partition function by direct summation of the exponential terms. By default, the number of the energy levels involved in the summation is in the variable glob.nlev, whose value is 1/2 of the dimension of the Hamiltonian matrix.

Parameters:
  • v – volume index (according to the list of volumes specified in the volumes.dat file)

  • temp – temperature (K)

  • nl – number of energy levels considered in the summation (default: 10)

plot_levels(iv, max_lev, qmin=0.0, qmax=0.0, tmin=300, tmax=1000, nt=5, degree=4, chk=False, temp=300)[source]

Computes and plots vibrational energy levels on top of the potential curve of the mode.

Parameters:
  • iv – Volume index (select the volume according to the input list)

  • max_lev – Number of levels to plot

  • qmin, qmax – Q-range (default: qmin=qmax=0. –> full range)

  • tmin, tmax – T-range for the computation of probability of of occupation of the vibrational levels (default: 300, 1000K)

  • nt – number of points in the T-range

  • degree – degree of the polynomial fitting the potential function (default: 4)

  • chk – check on the corvengence of the partition function (default: False)

  • temp – temperature for the check of the partition function (default: 300K)

set_up()[source]
single(temp=300, max_lev=5, qmin=0.0, qmax=0.0, tmin=300, tmax=1000, nt=4, nline=4, tail=4.0, head=4.0, sigma=2.0, fwhm=2.0, eta=1.0, npp=240)[source]

Computation in case of a single volume. Optional input parameters are those described for the plot_levels and spectrum functions.

spectrum(iv, temp, nline=5, tail=8.0, head=8.0, sigma=2.0, fwhm=2.0, eta=0.0, npp=240)[source]

Computes the spectrum of the anharmonic mode by using a specified peak shape

Parameters:
  • iv – Volume index

  • temp – Temperature (K)

  • nline – Number of lines to be considered

  • tail, head – the plotted range is [min(freq)-tail. max(freq)+head] where min(freq) and max(freq) are respectively the minum and maximum frequencis resulting from the “nline” transitions

  • sigma – sigma associated to the Gaussian profile

  • fwhm – full widthat half maximum associated to the Lorentzian profile

  • eta – Gaussian/Lorentzian ratio; eta=0: full Gaussian (G) profile eta=1: full Lorentzian (L) profile in general: profile=G*(1-eta)+L*eta

  • npp – number of points used for the plot

Note

The vertical lines drawn under the spectrum mark the positions of the transition frequencies. If the number of lines is greater than 3, a color code is associated to such lines; blue - transitions involving levels associated to low quantum numbers; green -transitions at intermediate quantum numbers; red - transition at high quantum numbers

start(temp=300, direct=False)[source]
start_fit(iv, npt=40)[source]