qdk_chemistry.data.time_evolution.controlled_time_evolution module

QDK/Chemistry controlled time evolution module.

class qdk_chemistry.data.time_evolution.controlled_time_evolution.ControlledTimeEvolutionUnitary(time_evolution_unitary, control_indices)[source]

Bases: DataClass

Data class for a controlled time evolution unitary.

Parameters:
__init__(time_evolution_unitary, control_indices)[source]

Initialize a ControlledTimeEvolutionUnitary.

Parameters:
  • time_evolution_unitary (TimeEvolutionUnitary) – The time evolution unitary to be controlled.

  • control_indices (list[int]) – The control qubit indices.

get_unitary_container_type()[source]

Get the type of the time evolution unitary container.

Return type:

str

Returns:

The type of the time evolution unitary container.

get_num_total_qubits()[source]

Get the total number of qubits including control qubits.

Return type:

int

Returns:

The total number of qubits (time evolution qubits + control qubits).

to_json()[source]

Convert the ControlledTimeEvolutionUnitary to a dictionary for JSON serialization.

Return type:

dict[str, Any]

Returns:

Dictionary representation of the ControlledTimeEvolutionUnitary

Return type:

dict

to_hdf5(group)[source]

Save the ControlledTimeEvolutionUnitary to an HDF5 group.

Return type:

None

Parameters:

group (h5py.Group) – HDF5 group or file to write the controlled time evolution unitary to

classmethod from_json(json_data)[source]

Create ControlledTimeEvolutionUnitary from a JSON dictionary.

Return type:

ControlledTimeEvolutionUnitary

Parameters:

json_data (dict[str, Any]) – Dictionary containing the serialized data

Returns:

ControlledTimeEvolutionUnitary

classmethod from_hdf5(group)[source]

Load a ControlledTimeEvolutionUnitary from an HDF5 group.

Return type:

ControlledTimeEvolutionUnitary

Parameters:

group (h5py.Group) – The HDF5 group containing the serialized object.

Returns:

ControlledTimeEvolutionUnitary

get_summary()[source]

Get summary of controlled time evolution unitary.

Return type:

str

Returns:

Summary string describing the ControlledTimeEvolutionUnitary’s contents and properties

Return type:

str