pyPRISM.core.System module

class pyPRISM.core.System.System(types, kT=1.0)[source]

Bases: object

Primary class used to spawn PRISM calculations

Description

The system object contains tables that fully describe a system to be simulated. This includes the domain definition, all site densities, site diameters, interaction potentials, intra-molecular correlation functions (\(\hat{\omega}(k)\)), and closures. This class also contains a convenience function for spawning a PRISM object.

Example

import pyPRISM

sys = pyPRISM.System(['A','B'])

sys.domain = pyPRISM.Domain(dr=0.1,length=1024)

sys.density['A'] = 0.1
sys.density['B'] = 0.75

sys.diameter[sys.types] = 1.0

sys.closure[sys.types,sys.types] = pyPRISM.closure.PercusYevick()

sys.potential[sys.types,sys.types] = pyPRISM.potential.HardSphere()

sys.omega['A','A'] = pyPRISM.omega.SingleSite()
sys.omega['A','B'] = pyPRISM.omega.InterMolecular()
sys.omega['B','B'] = pyPRISM.omega.Gaussian(sigma=1.0,length=10000)

PRISM = sys.createPRISM()

PRISM.solve()
__init__(types, kT=1.0)[source]
Parameters:
  • types (list) – Lists of the site types that define the system
  • kT (float) – Thermal temperature where \(k\) is the Boltzmann constant and \(T\) temperature. This is typicaly specified in reduced units where \(k_{B}=1.0\).
types

List of site types

Type:list
rank

Number of site types

Type:int
density

Container for all density values

Type:pyPRISM.core.Density
potential

Table of pair potentials between all site pairs in real space

Type:pyPRISM.core.PairTable
closure

Table of closures between all site pairs

Type:pyPRISM.core.PairTable
omega

Table of omega correlation functions in Fourier-space

Type:pyPRISM.core.PairTable
domain

Domain object which specifies the Real and Fourier space solution grid.

Type:pyPRISM.core.Domain
kT

Value of the thermal energy level. Used to vary temperature and scale the potential energy functions.

Type:float
diameter

Site diameters.

Warning

These diameters are currently only passed to the closures. They are not passed to potentials and it is up to the user to set sane sigma values that match these diameters.

Type:pyPRISM.core.ValueTable
check()[source]

Is everything in the system specified?

Raises:ValueError if all values are not set
createPRISM()[source]

Construct a PRISM object

Note

This method calls check() before creating the PRISM object.

Returns:PRISM – Fully specified PRISM object
Return type:pyPRISM.core.PRISM
iterpairs(full=False, diagonal=True)[source]

Convenience function for looping over type pairs.

Parameters:
  • full (bool) – If True, all i,j pairs (upper and lower diagonal) will be looped over
  • diagonal (bool) – If True, only the i==j (on-diagonal) pairs will be considered when looping
solve(*args, **kwargs)[source]

Construct a PRISM object and attempt a numerical solution

Note

See solve() for arguments to this function

Note

This method calls check() before creating the PRISM object.

Returns:PRISMSolved PRISM object
Return type:pyPRISM.core.PRISM