registry
registry
¤
OPERATOR_REGISTRY = ContextVar('OPERATOR_REGISTRY', default=OperatorRegistry.from_default_rules())
module-attribute
¤
Context variable holding the current global operator registry. This is updated when entering an operator registry context.
OperatorNotFound
¤
Bases: Exception
Source code in cirkit/symbolic/registry.py
12 13 14 15 16 17 18 | |
_operator = op
instance-attribute
¤
__init__(op)
¤
Source code in cirkit/symbolic/registry.py
13 14 15 | |
__repr__()
¤
Source code in cirkit/symbolic/registry.py
17 18 | |
OperatorRegistry
¤
Bases: AbstractContextManager
Source code in cirkit/symbolic/registry.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
_rules = defaultdict(dict)
instance-attribute
¤
_token = None
instance-attribute
¤
operators
property
¤
__enter__()
¤
Source code in cirkit/symbolic/registry.py
53 54 55 | |
__exit__(__exc_type, __exc_value, __traceback)
¤
Source code in cirkit/symbolic/registry.py
57 58 59 60 61 62 63 64 65 | |
__init__()
¤
Source code in cirkit/symbolic/registry.py
34 35 36 37 38 39 | |
add_rule(op, func)
¤
Source code in cirkit/symbolic/registry.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
from_default_rules()
classmethod
¤
Source code in cirkit/symbolic/registry.py
41 42 43 44 45 46 47 | |
has_rule(op, *signature)
¤
Source code in cirkit/symbolic/registry.py
67 68 69 70 71 72 73 74 75 76 77 78 79 | |
retrieve_rule(op, *signature)
¤
Source code in cirkit/symbolic/registry.py
81 82 83 84 85 86 87 88 | |
OperatorSignatureNotFound
¤
Bases: Exception
Source code in cirkit/symbolic/registry.py
21 22 23 24 25 26 27 28 29 30 | |
_operator = op
instance-attribute
¤
_signature = tuple(signature)
instance-attribute
¤
__init__(op, *signature)
¤
Source code in cirkit/symbolic/registry.py
22 23 24 25 | |
__str__()
¤
Source code in cirkit/symbolic/registry.py
27 28 29 30 | |