openfermion.utils.save_operator

Save FermionOperator or QubitOperator to file.

operator An instance of FermionOperator, BosonOperator, or QubitOperator.
file_name The name of the saved file.
data_directory Optional data directory to change from default data directory specified in config file.
allow_overwrite Whether to allow files to be overwritten.
plain_text Whether the operator should be saved to a plain-text format for manual analysis

OperatorUtilsError Not saved, file already exists.
TypeError Operator of invalid type.
TypeError Coefficients in Operator sympy expressions.