qdk_chemistry.data.unitary_representation.containers.base module
QDK/Chemistry unitary container base module.
- class qdk_chemistry.data.unitary_representation.containers.base.UnitaryContainer[source]
Bases:
DataClassAbstract class for a unitary container.
- static data_type_name()[source]
Return the wire-format identifier for unitary containers.
- Return type:
- Returns:
"unitary_container".
- abstract property type: str[source]
Get the type of the unitary container.
- Returns:
The type of the unitary container.
- abstract property num_qubits: int[source]
Get the number of qubits the unitary acts on.
- Returns:
The number of qubits.
- abstractmethod to_json()[source]
Convert the UnitaryContainer to a dictionary for JSON serialization.
- abstractmethod to_hdf5(group)[source]
Save the UnitaryContainer to an HDF5 group.
- Parameters:
group (
Group) – HDF5 group or file to write data to- Return type:
- abstractmethod classmethod from_json(json_data)[source]
Create UnitaryContainer from a JSON dictionary.
- abstractmethod classmethod from_hdf5(group)[source]
Load an instance from an HDF5 group.
- Parameters:
group (
Group) – HDF5 group or file to read data from- Return type:
- Returns:
UnitaryContainer
- abstractmethod get_summary()[source]
Get summary of unitary container.
- Returns:
Summary string describing the UnitaryContainer’s contents and properties
- Return type:
- abstractmethod eigenvalue_from_phase(phase_fraction)[source]
Recover a Hamiltonian eigenvalue from the measured phase fraction.
Each unitary encoding maps Hamiltonian eigenvalues to phases on the unit circle. This method inverts that mapping so that a measured phase fraction \(\varphi \in [0, 1)\) is converted back to the corresponding eigenvalue \(E\).
- abstractmethod combine(other)[source]
Combine this container with another to represent sequential application.
- Parameters:
other (
UnitaryContainer) – The container to append after this one.- Return type:
- Returns:
A new container representing the combined evolution.