create_mace¶
- jaxrens.backends.mace.create_mace(model_path=None, supercell_trafo=(2, 2, 2), **kwargs)[source]¶
Create a MACE-JAX energy backend from any supported model file.
Single front door for every on-disk shape a converted MACE model can take. Dispatches by path so callers (and the YAML
checkpoint_path) never have to know which container they hold:.pkl— a{graphdef, state, ...}pickle (seecreate_mace_from_pickle()); the only shape that stores the split module directly rather than config + msgpack params.everything else — handed to mace-jax’s
load_model_bundle, which already accepts a bundle directory (config.json+params.msgpack), a looseconfig.json/params.msgpackpair (pass either file), a.ckptorbax checkpoint, and themace-jax-from-torchoutput (a msgpack blob named<name>-jax.npzwith a sibling<name>-jax.json; pass the.npz). Note the converter’s.npzis msgpack, not a numpy archive, and only resolves when its same-stem.jsonsits next to it.
The backend always runs in float32. mace-jax’s bundle loader toggles
jax_enable_x64based on thedtypepassed toload_model_bundle; we pin it to float32 so the rest of jaxrens (cells / positions / energies are all float32 by construction) doesn’t get silently promoted.- Parameters:
model_path (str | None) – Path to a model bundle directory,
config.json/params.msgpack/.npzparams file,.ckptcheckpoint, or.pklgraphdef+state pickle.supercell_trafo (tuple[int, int, int]) – (sc_a, sc_b, sc_c) supercell expansion for neighbor finding. Must satisfy min(cell_diag * sc) >= 2 * r_cutoff.
kwargs (Any)
- Returns:
MACEBackend instance.
- Return type: