hipart — Fuzzy atom partitioning
All HiPart scripts use the modules described below to perform their analysis.
The internals of HiPart can also be used to write your own population analysis
code.
hipart.context — Contexts instead of global variables
-
exception hipart.context.ContextError
-
class hipart.context.Context(filename, options)
This class is an extension to the concept of global variables.
It ensures that an entire context of data structures, files and
directories is present and sane. One can pass around a context variable
instead of the individual global variables.
-
check_tag(extra)
Make sure our context is compatible with the data in the workdir.
-
num_lebedev
-
version = 2
-
class hipart.context.Options(lebedev=110, do_clean=False, do_work=True, do_output=True, verbose=True, threshold=0.0001, max_iter=500, fix_total_charge=True, do_random=True, save_mem=False)
hipart.schemes — Partitioning schemes and derived quantities
-
exception hipart.schemes.ParseError
hipart.wavefn — Electronic structure representation
-
hipart.wavefn.load_wavefunction(filename)
-
class hipart.wavefn.FCHKWaveFunction(filename, options)
-
compute_atomic_overlap(grid, weights)
-
compute_density(grid)
-
compute_orbitals(grid)
-
compute_potential(grid)
-
compute_spin_density(grid)
-
init_naturals(work)
-
log()
-
hipart.wavefn.get_num_filled(occupations)
-
hipart.wavefn.compute_naturals(dmat, num_dof)
-
class hipart.atoms.AtomProfile(number, rgrid, records)
-
get_atom_fn(population=None)
-
class hipart.atoms.AtomTable(filename)
-
class hipart.atomdb.Options(lebedev=110, rlow=2e-05, rhigh=20.0, num_steps=100, max_ion=2, qc=False, do_work=True, verbose=True, do_random=True)
-
hipart.atomdb.run_atomdb(executable, lot, atom_numbers, options, directory='.')
-
hipart.atomdb.main(args=None)
hipart.fit — ESP cost functions
-
class hipart.fit.ChargeDipoleCostFunction(N, design_matrix, expected_values, weights, total_charge)
-
correlation(charges, dipoles=None)
-
full_vector(charges, dipoles=None)
-
model_rms(charges, dipoles=None)
-
rmsd(charges, dipoles=None)
-
write_to_file(filename)
-
class hipart.fit.ESPCostFunction(coordinates, grid_points, grid_weights, densities, potentials, total_charge)
hipart.grids — Numerical integration grids
-
class hipart.grids.Grid(prefix, work, points, dump=True)
-
dump(suffix, array, ignore=False)
-
classmethod from_prefix(prefix, work)
-
load(suffix, shape=None)
-
size
-
class hipart.grids.AtomicGrid(prefix, work, points, dump=True)
-
classmethod from_parameters(prefix, work, center, rgrid, agrid)
-
class hipart.grids.RBaseIntGrid(rs)
-
get_description()
-
get_weights(size=None)
-
integrate(integrand)
-
integrate_cumul(integrand)
-
class hipart.grids.RLogIntGrid(r_low, r_high, steps)
-
get_description()
-
class hipart.grids.REquiIntGrid(r_low, r_high, steps)
-
get_description()
-
hipart.grids.get_rgrid_from_description(s)
-
class hipart.grids.ABaseIntGrid
-
generate_points(center, rs)
-
get_description()
-
integrate(integrand)
-
minimum(function)
-
class hipart.grids.ALebedevIntGrid(num_lebedev, do_random=True)
-
generate_points(center, rs)
-
get_description()
-
integrate(integrand)
-
maximum(function)
-
minimum(function)
-
hipart.lebedev_laikov.get_grid(number)
hipart.spline — Cubic spline interpolation
-
class hipart.spline.LinearSpline(x, y)
-
__call__(x)
-
class hipart.spline.CubicSpline(x, y)
-
__call__(x)
hipart.io — IO for Hipart file formats
-
class hipart.io.Output(directory=None, numbers=None)
-
active
-
dump_atom_fields(filename, table, labels, name)
-
dump_atom_matrix(filename, matrix, name)
-
dump_atom_scalars(filename, scalars, name)
-
dump_atom_vectors(filename, vectors, name)
-
dump_esp_cost(filename, esp_cost)
-
dump_esp_test(filename, dipole_q, dipole_p, dipole_qp, dipole_qm, mol_esp_cost, charges, dipoles)
-
dump_overlap_matrices(filename, overlap_matrices)
-
hipart.io.dump_atom_scalars(filename, scalars, name, numbers=None)
Dump an array of scalar atomic quantities into a text file.
- Arguments:
filename – The file to dump in.
scalars – An array of scalars, e.g. atomic charges.
- Optional arguments:
numbers – An array with atomic numbers to decorate the file
name – the name of the quantity to decorate the file
-
hipart.io.load_atom_scalars(filename)
Load atomic scalars written with dump_atom_scalars().
- Argument:
filename – The file to load from.
Returns the array with scalars.
-
hipart.io.dump_atom_vectors(filename, vectors, name, numbers=None)
Dump an array of atomic 3D-vector quantities into a text file.
- Arguments:
filename – The file to dump in.
vectors – An array of 3D-vectors, e.g. atomic dipoles.
- Optional arguments:
numbers – An array with atomic numbers to decorate the file
name – the name of the quantity to decorate the file
-
hipart.io.load_atom_vectors(filename)
Load atomic vectors written with dump_atom_vectors().
- Argument:
filename – The file to load from.
Returns the array with vectors.
-
hipart.io.dump_atom_matrix(filename, matrix, name, numbers=None)
Dump a 2D-array of atomic pair quantities into a text file.
- Arguments:
filename – The file to dump in.
matrix – A 2D-array of atomic pair quantities, e.g. bond
orders.
- Optional arguments:
numbers – An array with atomic numbers to decorate the file
name – the name of the quantity to decorate the file
-
hipart.io.load_atom_matrix(filename)
Load atomic pair quantities written with dump_atom_matrix().
- Argument:
filename – The file to load from.
Returns the square array with pair quantities.
-
hipart.io.dump_atom_fields(filename, table, labels, name, numbers=None)
Dump a table with multiple scalar atomic quantities into a text file.
- Arguments:
filename – The file to dump in.
table – A 2D-array of atomic scalar quantities, e.g. the atomic
multipole expansions. Each column corresponds to a
quantity and each row corresponds to an atom.
labels – The labels of the atomic quantities. The number of
labels and the number of columns in the table must be
the same.
- Optional arguments:
numbers – An array with atomic numbers to decorate the file
name – the name of the quantity to decorate the file
-
hipart.io.load_atom_fields(filename)
Load multiple atomic quantities written with dump_atom_fields().
- Argument:
filename – The file to load from.
Returns a tuple with two results: (i) the table with atomic scalar
quantities and (ii) the labels from the table header.
-
hipart.io.dump_overlap_matrices(filename, overlap_matrices, numbers=None)
Dump a the atomic overlap matrices into a text file.
- Arguments:
filename – The file to dump in.
overlap_matrices – A list with (square) atomic overlap
matrices.
- Optional arguments:
numbers – An array with atomic numbers to decorate the file
hipart.opts — Command line parsion for hi-*.py scripts
-
hipart.opts.parse_command_line(script_usage)
-
class hipart.log.ProgressBar(label, n, indent=0, width=80, verbose=True)
-
__call__(inc=1)
-
dump(s)
-
class hipart.log.Log
-
__call__(s)
-
begin(s)
-
end()
-
level
-
pb(s, num)
-
set_verbose(verbose)
hipart.work — Control temporary work files
-
class hipart.work.Work(directory=None, do_clean=False)
-
active
-
clean()
-
create()
-
dump(name, array, ignore=False)
-
load(name, shape=None)