Dice Python Frontend Documentation
|
Functions | |
def | QHOProbPlot (chain_file) |
Wrapper function for QHO_prob_plot() More... | |
def | QHO_prob_plot (positions, energies) |
Fancy Plotly plotter for QHO Markov chains. More... | |
def | HydProbPlot (chain_file, opacity=0.2) |
Wrapper function for H2_prob_plot() More... | |
def | H2_prob_plot (positions, energies, R1, R2, opacity) |
Plots the sampled wavefunction for H2plus/H2. More... | |
def | QHOEnergyPlot (results_file, sliceby=(None, None)) |
Energy against \( \alpha \) plotter for the QHO problem. More... | |
def | QHOWfnPlot (chain_file, show_analytic=False) |
Scatter plotter of the sampled QHO wavefunction. More... | |
def | H2plusEnergyPlot (results_file, sliceby=(None, None)) |
\( H_{2}^{+} \) H-H bond energy and parameter plotter. More... | |
def | H2EnergyPlot (results_file, sliceby=(None, None)) |
\( H_{2} \) H-H bond energy and parameter plotter. More... | |
def | view_original_trace (equil_file) |
Plots the original trace(s) of an MCMC run. More... | |
def | BurnThinUI (equil_file) |
Wrapper function for interacting with get_autocorrelation_time() More... | |
def | get_autocorrelation_time (filename, burn, tuning, plotting=True) |
Function which suggests a thinning parameter for a MCMC chain. More... | |
def | load_results (filename='results.nc') |
Loads the results as a dataset NetCDF object to be passed to other functions. More... | |
def | load_global_attr (rootgrp, verbose=True) |
Loads the global metadata in the results file into a dictionary. More... | |
def | load_variables (rootgrp, verbose=True) |
Loads the variables in the results file into a dictionary. More... | |
def | H2_eng_plot (variables) |
Plots the energies against the parameters checked during the grid search Parameters: variables: Dictionary which contains data about the variables in the netcdf4 object. More... | |
def | QHO_eng_plot (rootgrp, equil=False) |
energy_plot() Plots the energy at each step as the MC converges More... | |
def | plot_3D (X, Y, Z, wfn) |
def | process_main_results (filename='results.nc', verbose=True) |
Processes the results output as a result of the parameter search from the NetCDF4 file. More... | |
def | plot_markov_chain (filename) |
def | orb_1s (X, Y, Z, R_a) |
functions plotting the wavefunction ab initio ####### More... | |
def | orb_2s (r, R_a) |
def | polar_to_cart (r, theta, phi) |
def | lcao_wfn (X, Y, Z, R1, R2, pqn=1) |
def | plot_3D (X, Y, Z, wfn, R1, R2) |
Function for plotting the wavefunction analytically. More... | |
def | example_H1s_wfn (bond_length=2.0) |
def repo.DicePy.dice_visualise.QHOProbPlot | ( | chain_file | ) |
Wrapper function for QHO_prob_plot()
Loads in the netCDF dataset and extracts position and energy arrays, passes them off to QHO_prob_plot().
[in] | chain_file | The main netCDF output file from a Full VQMC run with write_chains=.TRUE. |
Definition at line 27 of file dice_visualise.py.
def repo.DicePy.dice_visualise.QHO_prob_plot | ( | positions, | |
energies | |||
) |
Fancy Plotly plotter for QHO Markov chains.
[in] | positions | Position array from Markov chain |
[in] | energies | Energy array from Markov chain |
Definition at line 48 of file dice_visualise.py.
def repo.DicePy.dice_visualise.HydProbPlot | ( | chain_file, | |
opacity = 0.2 |
|||
) |
Wrapper function for H2_prob_plot()
Loads in the netCDF dataset and extracts position and energy arrays, passes them off to H2_prob_plot().
[in] | chain_file | The main netCDF output file from a Full VQMC run with write_chains=.TRUE. |
[in] | opacity | (Optional, default=0.2) Opacity of the electron position scatter plot |
Definition at line 75 of file dice_visualise.py.
def repo.DicePy.dice_visualise.H2_prob_plot | ( | positions, | |
energies, | |||
R1, | |||
R2, | |||
opacity | |||
) |
Plots the sampled wavefunction for H2plus/H2.
[in] | positions | XYZ coordinates of Markov chain |
[in] | energies | Energies of the Markov chains |
[in] | R1 | The XYZ coordinates of the first atom |
[in] | R2 | The XYZ coordinates of the second atom |
[in] | opacity | Opacity of the electron position scatter plot |
fig | Plotly figure object |
Definition at line 102 of file dice_visualise.py.
def repo.DicePy.dice_visualise.QHOEnergyPlot | ( | results_file, | |
sliceby = (None, None) |
|||
) |
Energy against \( \alpha \) plotter for the QHO problem.
Plots the VQMC wavefunction energy at each of an array of values for the variational parameter \( \alpha \), alongside error bars of the standard deviation in each energy.
[in] | results_file | The main netCDF output file from a QHO run |
[in] | sliceby | (Optional) Tuple containing slice intervals for arrays |
Definition at line 178 of file dice_visualise.py.
def repo.DicePy.dice_visualise.QHOWfnPlot | ( | chain_file, | |
show_analytic = False |
|||
) |
Scatter plotter of the sampled QHO wavefunction.
Plots the sampled positions of a trial QHO wavefunction against the energies at those positions, to illustrate the shape of that wavefunction. Chain output requires the write_chains parameter to be TRUE.
[in] | chain_file | A netCDF dataset of Markov chain and corresponding energies of a VQMC run |
[in] | show_analytic | Also display the analytical wavefunction |
Definition at line 217 of file dice_visualise.py.
def repo.DicePy.dice_visualise.H2plusEnergyPlot | ( | results_file, | |
sliceby = (None, None) |
|||
) |
\( H_{2}^{+} \) H-H bond energy and parameter plotter.
Plots the H-H bond potential energy curve generated by VQMC at the optimum parameters for each bond length. Plots standard deviation of each energy as a measure of uncertainty. Also plots variational parameter \( c \) against bond length. Reports equilibrium bond length for the molecule and optimum energy.
[in] | results_file | The main netCDF output file from a \( H_{2}^{+} \) run |
[in] | sliceby | (Optional) Tuple containing slice intervals for arrays |
Definition at line 251 of file dice_visualise.py.
def repo.DicePy.dice_visualise.H2EnergyPlot | ( | results_file, | |
sliceby = (None, None) |
|||
) |
\( H_{2} \) H-H bond energy and parameter plotter.
Plots the H-H bond potential energy curve generated by VQMC at the optimum parameters for each bond length. Plots standard deviation of each energy as a measure of uncertainty. Also plots variational parameters \( a \) and \( \beta \) against bond length. Reports equilibrium bond length for the molecule and optimum energy.
[in] | results_file | The main netCDF output file from a \( H_{2} \) run |
[in] | sliceby | (Optional) Tuple containing slice intervals for arrays |
Definition at line 303 of file dice_visualise.py.
def repo.DicePy.dice_visualise.view_original_trace | ( | equil_file | ) |
Plots the original trace(s) of an MCMC run.
[in] | equil_file | Filename of MCMC equilibration run |
Definition at line 366 of file dice_visualise.py.
def repo.DicePy.dice_visualise.BurnThinUI | ( | equil_file | ) |
Wrapper function for interacting with get_autocorrelation_time()
[in] | equil_file | Filename of MCMC equilibration run |
Definition at line 388 of file dice_visualise.py.
def repo.DicePy.dice_visualise.get_autocorrelation_time | ( | filename, | |
burn, | |||
tuning, | |||
plotting = True |
|||
) |
Function which suggests a thinning parameter for a MCMC chain.
Takes as input a burning parameter and a tuning parameter which controls how aggressively you tune out autocorrelation in the trace, and prints a suggested thinning parameter (if one was found). Intention is to use interactively, to illustrate procedure for burning and thinning, as default values are provided. Plots generated are the autocorrelation as a function of lag time, and the burnt and thinned trace / chain.
[in] | filename | Filename of MCMC equilibration run |
[in] | burn | Number of samples from chain to burn / discard |
[in] | tuning | Parameter which controls aggression of thinning |
[in] | plotting | Controls whether to display plots |
Definition at line 415 of file dice_visualise.py.
def repo.DicePy.dice_visualise.load_results | ( | filename = 'results.nc' | ) |
Loads the results as a dataset NetCDF object to be passed to other functions.
Parameters: filename: The name of the file containing the results, defaults to 'results.nc'.
Definition at line 506 of file dice_visualise.py.
def repo.DicePy.dice_visualise.load_global_attr | ( | rootgrp, | |
verbose = True |
|||
) |
Loads the global metadata in the results file into a dictionary.
Parameters: rootgrp: NetCDF4 dataset object which loaded in using 'load_results()'. verbose: Defaults to true. Prints the value of global attributes which have been loaded
Definition at line 520 of file dice_visualise.py.
def repo.DicePy.dice_visualise.load_variables | ( | rootgrp, | |
verbose = True |
|||
) |
Loads the variables in the results file into a dictionary.
Parameters: rootgrp: NetCDF4 dataset object which loaded in using 'load_results()' verbose: Defaults to true. Prints the value of variables which have been loaded
Definition at line 539 of file dice_visualise.py.
def repo.DicePy.dice_visualise.H2_eng_plot | ( | variables | ) |
Plots the energies against the parameters checked during the grid search Parameters: variables: Dictionary which contains data about the variables in the netcdf4 object.
Definition at line 555 of file dice_visualise.py.
def repo.DicePy.dice_visualise.QHO_eng_plot | ( | rootgrp, | |
equil = False |
|||
) |
energy_plot() Plots the energy at each step as the MC converges
Definition at line 584 of file dice_visualise.py.
def repo.DicePy.dice_visualise.plot_3D | ( | X, | |
Y, | |||
Z, | |||
wfn | |||
) |
Definition at line 603 of file dice_visualise.py.
def repo.DicePy.dice_visualise.process_main_results | ( | filename = 'results.nc' , |
|
verbose = True |
|||
) |
Processes the results output as a result of the parameter search from the NetCDF4 file.
Parameters: filename: Defaults to 'results.nc'. The file which contains the data output by the parameter search
Definition at line 621 of file dice_visualise.py.
def repo.DicePy.dice_visualise.plot_markov_chain | ( | filename | ) |
Definition at line 654 of file dice_visualise.py.
def repo.DicePy.dice_visualise.orb_1s | ( | X, | |
Y, | |||
Z, | |||
R_a | |||
) |
functions plotting the wavefunction ab initio #######
Definition at line 680 of file dice_visualise.py.
def repo.DicePy.dice_visualise.orb_2s | ( | r, | |
R_a | |||
) |
Definition at line 688 of file dice_visualise.py.
def repo.DicePy.dice_visualise.polar_to_cart | ( | r, | |
theta, | |||
phi | |||
) |
Definition at line 694 of file dice_visualise.py.
def repo.DicePy.dice_visualise.lcao_wfn | ( | X, | |
Y, | |||
Z, | |||
R1, | |||
R2, | |||
pqn = 1 |
|||
) |
Definition at line 702 of file dice_visualise.py.
def repo.DicePy.dice_visualise.plot_3D | ( | X, | |
Y, | |||
Z, | |||
wfn, | |||
R1, | |||
R2 | |||
) |
Function for plotting the wavefunction analytically.
Meshgrids can be generated using np.meshgrid(x,y,z)
Parameters: X: Meshgrid of X coordinates Y: Meshgrid of Y coordinates Z: Meshgrid of Z coordinates
Definition at line 712 of file dice_visualise.py.
def repo.DicePy.dice_visualise.example_H1s_wfn | ( | bond_length = 2.0 | ) |
Definition at line 752 of file dice_visualise.py.