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 by data_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 with PersistedJobData.json().

Returns:

dict[str, Any] – Dict with same keys as data_dictionary and values serialized to the specified data_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 by data_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 specified data_format to plaintext.