We're celebrating World Quantum Day 2022! Join us


Construct a dictionary containing attributes from obj

This is useful as a helper function in objects implementing the SupportsJSON protocol, particularly in the _jsondict method.

In addition to keys and values specified by attribute_names, the returned dictionary has an additional key "cirq_type" whose value is the string name of the type of obj.

obj A python object with attributes to be placed in the dictionary.
attribute_names The names of attributes to serve as keys in the resultant dictionary. The values will be the attribute values.
namespace An optional prefix to the value associated with the key "cirq_type". The namespace name will be joined with the class name via a dot (.)