app.enricher.models =================== .. py:module:: app.enricher.models .. autoapi-nested-parse:: Database schema for the enricher nodes. Module Contents --------------- .. py:class:: NodeType(*args, **kwds) Enum for different node types. .. py:attribute:: ENCODE :value: 'encode' Node for encoding classical data into quantum states. .. py:attribute:: PREPARE :value: 'prepare' Node for preparing predefined quantum states. .. py:attribute:: OPERATOR :value: 'operator' Node representing a classical or quantum operator. .. py:class:: EncodingType(*args, **kwds) Enum for supported encoding types. .. py:attribute:: AMPLITUDE :value: 'amplitude' Amplitude encoding of quantum states. .. py:attribute:: ANGLE :value: 'angle' Angle encoding of quantum states. .. py:attribute:: BASIS :value: 'basis' Basis state encoding. .. py:attribute:: MATRIX :value: 'matrix' Matrix-based custom encoding. .. py:attribute:: SCHMIDT :value: 'schmidt' Schmidt decomposition-based encoding. .. py:class:: QuantumStateType(*args, **kwds) Enum for quantum state preparation options. .. py:attribute:: PHI_PLUS :value: 'ϕ+' Bell state ``|ϕ+⟩`` .. py:attribute:: PHI_MINUS :value: 'ϕ-' Bell state ``|ϕ-⟩`` .. py:attribute:: PSI_PLUS :value: 'ψ+' Bell state ``|ψ+⟩`` .. py:attribute:: PSI_MINUS :value: 'ψ-' Bell state ``|ψ-⟩`` .. py:attribute:: GHZ :value: 'ghz' Greenberger-Horne-Zeilinger state. .. py:attribute:: UNIFORM :value: 'uniform' Uniform superposition state. .. py:attribute:: W :value: 'w' W-state. .. py:class:: OperatorType(*args, **kwds) Enum for supported classical and quantum operators. .. py:attribute:: ADD :value: '+' Addition operator (+). .. py:attribute:: SUB :value: '-' Subtraction operator (-). .. py:attribute:: MUL :value: '*' Multiplication operator (*). .. py:attribute:: DIV :value: '/' Division operator (/). .. py:attribute:: POW :value: '**' Exponentiation operator (**). .. py:attribute:: OR :value: '|' Bitwise OR (|). .. py:attribute:: AND :value: '&' Bitwise AND (&). .. py:attribute:: NOT :value: '~' Bitwise NOT (~). .. py:attribute:: XOR :value: '^' Bitwise XOR (^). .. py:attribute:: LT :value: '<' Less than (<). .. py:attribute:: LE :value: '<=' Less than or equal to (<=). .. py:attribute:: GT :value: '>' Greater than (>). .. py:attribute:: GE :value: '>=' Greater than or equal to (>=). .. py:attribute:: EQ :value: '==' Equality comparison (==). .. py:attribute:: NEQ :value: '!=' Inequality comparison (!=). .. py:attribute:: MIN :value: 'min' Minimum of two values. .. py:attribute:: MAX :value: 'max' Maximum of two values. .. py:class:: InputType(*args, **kwds) Enum for types of inputs to node implementations. .. py:attribute:: IntType :value: 'IntType' Classical integer input. .. py:attribute:: FloatType :value: 'FloatType' Classical float input. .. py:attribute:: BitType :value: 'BitType' Classical bit input. .. py:attribute:: BoolType :value: 'BoolType' Boolean value input. .. py:attribute:: QubitType :value: 'QubitType' Quantum input (qubit). .. py:class:: Base SQLAlchemy declarative base class for table definitions. .. py:class:: BaseNode Base class for all nodes. :param id: ID and primary key of a node :param type: One of the types defined in :class:`~app.enricher.models.NodeType` :param depth: Depth of the node implementation :param width: Width of the node implementation :param implementation: Implementation of the node :param inputs: 1-n-Relationship with :class:`~app.enricher.models.Input` .. py:class:: Input Input class to store input information for nodes. :param id: Primary key. :param index: Input index within the node. :param type: Type of the input from :class:`~app.enricher.models.InputType`. :param size: Optional size for array-based types. :param node_id: Foreign key to the parent node. :param node: Back-reference to the parent :class:`~app.enricher.models.BaseNode`. .. py:class:: EncodeValueNode Special properties of EncodeValueNode. :param id: Foreign key to the id of the :class:`~app.enricher.models.BaseNode` :param encoding: Type of encoding defined by :class:`~app.enricher.models.EncodingType` :param bounds: Bound of the encode value node .. py:class:: PrepareStateNode Special properties of PrepareStateNode :param id: Foreign key to the id of the :class:`~app.enricher.models.BaseNode` :param size: Integer value for the size the implementation supports :param quantum_state: Quantum state of the implementation defined by :class:`~app.enricher.models.QuantumStateType` .. py:class:: OperatorNode Special properties of OperatorNode :param: id: Foreign key to the id of the :class:`~app.enricher.models.BaseNode` :param: operator: Operator the implementation supports