braket.jobs.serialization module
- braket.jobs.serialization.serialize_values(data_dictionary: dict[str, Any], data_format: PersistedJobDataFormat) dict[str, Any] [source]
Serializes the
data_dictionary
values to the format specified bydata_format
.- Parameters:
data_dictionary (dict[str, Any]) – Dict whose values are to be serialized.
data_format (PersistedJobDataFormat) – The data format used to serialize the values. Note that for
PICKLED
data formats, the values are base64 encoded after serialization, so that they represent valid UTF-8 text and are compatible withPersistedJobData.json()
.
- Returns:
dict[str, Any] – Dict with same keys as
data_dictionary
and values serialized to the specifieddata_format
.
- braket.jobs.serialization.deserialize_values(data_dictionary: dict[str, Any], data_format: PersistedJobDataFormat) dict[str, Any] [source]
Deserializes the
data_dictionary
values from the format specified bydata_format
.- Parameters:
data_dictionary (dict[str, Any]) – Dict whose values are to be deserialized.
data_format (PersistedJobDataFormat) – The data format that the
data_dictionary
values are currently serialized with.
- Returns:
dict[str, Any] – Dict with same keys as
data_dictionary
and values deserialized from the specifieddata_format
to plaintext.