We should support saving and loading most classes. Here is an example of what I've used for the UCJ operators:
np.savez_compressed(
operator_path,
diag_coulomb_mats=lucj_op.diag_coulomb_mats,
orbital_rotations=lucj_op.orbital_rotations,
final_orbital_rotation=lucj_op.final_orbital_rotation,
)
operator_data = np.load(data_dir / lucj_operator_task.dirpath / "operator.npz")
lucj_op = ffsim.UCJOpSpinBalanced(
diag_coulomb_mats=operator_data["diag_coulomb_mats"],
orbital_rotations=operator_data["orbital_rotations"],
final_orbital_rotation=operator_data["final_orbital_rotation"],
)
We should support saving and loading most classes. Here is an example of what I've used for the UCJ operators: