PytketCircuitProto

class tket.util.PytketCircuitProto(*args, **kwargs)[source]

Bases: Protocol

Protocol for classes that can be serialized as a pytket Circuit.

This is used to allow type annotations that refer to pytket Circuits without requiring pytket to be installed.

__init__(*args, **kwargs)
to_dict()[source]

Convert this circuit to a dictionary representation.

Return type:

dict

Returns:

A JSON serializable dictionary representation of the Circuit.