pub enum Command {
Show 17 variants
InitForceEnv {
input: String,
output: String,
},
InitForceEnvWithGeometry {Show 19 fields
input: Cp2kInputSpec,
output: String,
symbols: Vec<String>,
positions_angstrom: Vec<f64>,
cell_angstrom: Vec<f64>,
periodic: String,
project_label: Option<String>,
print_level: Option<String>,
run_type: Option<String>,
charge: Option<i32>,
multiplicity: Option<i32>,
walltime: Option<String>,
seed: Option<Vec<i32>>,
echo_input: Option<bool>,
uks: Option<bool>,
roks: Option<bool>,
wfn_restart_file: Option<String>,
kpoint_config: Option<KPointConfig>,
dos_config: Option<DosConfig>,
},
CalcEnergyForce,
CalcEnergy,
GetNatom,
GetNparticle,
GetPositions,
GetForces,
GetPotentialEnergy,
GetCell,
GetQmmmCell,
SetPositions {
data: Vec<f64>,
},
SetVelocities {
data: Vec<f64>,
},
SetCell {
data: Vec<f64>,
},
GetMoCount,
Shutdown,
GetVersion,
}Expand description
A command sent from the Python frontend to the worker.
Variants§
InitForceEnv
Initialize a new force environment.
This is the legacy entry point that takes a path to a .inp file.
Prefer [InitForceEnvWithGeometry], which supports geometry injection.
InitForceEnvWithGeometry
Initialise a new force environment and supply the starting geometry.
The worker constructs a temporary input by taking the input specified by
input_spec and injecting &CELL and &COORD sections into &SUBSYS
before passing the (temporary) file to CP2K.
For input_spec = FromFile, the file is read and patched.
For input_spec = Generated, the settings are rendered and then patched
(patching is still used to guarantee geometry correctness).
§Fields
input_spec Input source (file or generated settings).
output Path for CP2K output.
symbols Element symbol for each atom, e.g. ["W", "Al", "O"].
positions_angstrom Flat interleaved array [x0,y0,z0, x1,y1,z1, …] in Å.
cell_angstrom 9-element row-major cell matrix in Å.
cell_angstrom[i*3 + j] = j-th component of i-th lattice vector.
periodic Periodicity string passed to CP2K’s PERIODIC keyword.
Use "XYZ" for fully periodic systems (the common case),
"NONE" for isolated molecules. Any valid CP2K PERIODIC
token is accepted.
Fields
input: Cp2kInputSpeckpoint_config: Option<KPointConfig>Optional k-point configuration for periodic systems
CalcEnergyForce
Calculate energy and forces for the current geometry.
CalcEnergy
Calculate energy only.
GetNatom
Query the number of atoms.
GetNparticle
Query the number of particles.
GetPositions
Retrieve particle positions as a flat f64 array.
GetForces
Retrieve forces as a flat f64 array.
GetPotentialEnergy
Retrieve the potential energy.
GetCell
Retrieve the 3x3 simulation cell (row-major flat f64).
GetQmmmCell
Retrieve the 3x3 QMMM cell.
SetPositions
Set particle positions.
SetVelocities
Set particle velocities.
SetCell
Set simulation cell (9 floats, row-major).
GetMoCount
Get number of MOs in the active space.
Shutdown
Ask the worker to shut down cleanly.
GetVersion
Get CP2K version string.