relentless.model.Ensemble#
- class relentless.model.Ensemble(T, N, V=None, P=None)#
Thermodynamic ensemble.
An ensemble is defined by:
The temperature
T.The number
Nfor each particle type. The particle types are strings determined from the keys ofN.The extent
Vand/or pressureP.
- Parameters:
Methods
copy()Make a copy of the ensemble.
from_file(filename)Construct an Ensemble from a JSON file.
from_json(data)Create from JSON data.
save(filename)Save as a JSON file.
to_json()Export to a JSON-compatible dictionary.
Attributes
FixedKeyDict: Number of particles of each type.The pressure of the system.
The temperature.
The extent of the system.
PairMatrix: Radial distribution function per pair.The types in the ensemble.
- property N#
FixedKeyDict: Number of particles of each type.
- property V#
The extent of the system.
- Type:
Extent
- copy()#
Make a copy of the ensemble.
- Returns:
A new Ensemble object having the same state.
- Return type:
- classmethod from_file(filename)#
Construct an Ensemble from a JSON file.
- classmethod from_json(data)#
Create from JSON data.
It is assumed that the data is compatible with the object.
- Parameters:
data (dict) – JSON data for ensemble.
- property rdf#
PairMatrix: Radial distribution function per pair.