Skip to content

Environment

get_ion_counts(simulation_context, system_charge, n_waters, water_molecule_volume=28.78277638661025)

Compute the number of cations and anions to achieve desired ionic strength.

PARAMETER DESCRIPTION
simulation_context

A simulation context for system preparation.

TYPE: SimulationContextManager

system_charge

Total system charge. Will add counter ions if neutralize_charge is True in simulation_context.

TYPE: int | float

n_waters

Total number of water molecules in the system.

TYPE: int

water_molecule_volume

Approximate volume of a water molecule in cubic Angstroms.

TYPE: float DEFAULT: 28.78277638661025

RETURNS DESCRIPTION
dict[str, int]

Cations and anions that needs to be added to the system. For example, 2 would

dict[str, int]

mean two cations need to be added, but -2 would mean two anions.