qdk_chemistry.migrate._ansatz module

Migrate the Ansatz serialization schema to the current version.

An Ansatz is an envelope around a Hamiltonian and a Wavefunction. The envelope itself ({type, version, hamiltonian, wavefunction}) is schema-stable, so this converter has no version step of its own; it migrates each embedded payload through that payload’s own serialization-version chain.

qdk_chemistry.migrate._ansatz.from_json_doc(doc)[source]

Normalize a parsed legacy Ansatz JSON object into an old-doc.

Return type:

dict

Parameters:

doc (dict)

qdk_chemistry.migrate._ansatz.from_hdf5_file(path)[source]

Read a legacy Ansatz HDF5 file into an old-doc.

Return type:

dict

qdk_chemistry.migrate._ansatz.to_new_json(old)[source]

Build the migrated Ansatz JSON object by migrating each embedded payload’s chain.

Return type:

dict

Parameters:

old (dict)