Serialization
- braket.jobs.serialization.serialize_values(data_dictionary, data_format)[source]
Serializes the
data_dictionaryvalues 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
PICKLEDdata formats, the values are base64 encoded after serialization, so that they represent valid UTF-8 text and are compatible withPersistedJobData.json().
- Return type:
dict[str,Any]- Returns:
dict[str, Any] – Dict with same keys as
data_dictionaryand values serialized to the specifieddata_format.
- braket.jobs.serialization.deserialize_values(data_dictionary, data_format)[source]
Deserializes the
data_dictionaryvalues 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_dictionaryvalues are currently serialized with.
- Return type:
dict[str,Any]- Returns:
dict[str, Any] – Dict with same keys as
data_dictionaryand values deserialized from the specifieddata_formatto plaintext.