Skip to main content
Ctrl+K

DisCoPy

Reference API

  • syntax
    • cat
      • Ob
      • Arrow
      • Box
      • Id
      • Sum
      • Bubble
      • Category
      • Functor
      • Composable
      • factory
      • dumps
      • loads
    • monoidal
      • Ty
      • PRO
      • Layer
      • Diagram
      • Box
      • Sum
      • Bubble
      • Category
      • Functor
      • Whiskerable
    • braided
      • Diagram
      • Box
      • Braid
      • Sum
      • Category
      • Functor
      • hexagon
    • balanced
      • Diagram
      • Box
      • Braid
      • Twist
      • Sum
      • Category
      • Functor
    • symmetric
      • Diagram
      • Box
      • Swap
      • Sum
      • Category
      • Functor
    • markov
      • Diagram
      • Box
      • Swap
      • Copy
      • Category
      • Functor
    • traced
      • Diagram
      • Box
      • Trace
      • Category
      • Functor
    • closed
      • Ty
      • Exp
      • Over
      • Under
      • Diagram
      • Box
      • Eval
      • Curry
      • Sum
      • Category
      • Functor
    • rigid
      • Ob
      • Ty
      • PRO
      • Diagram
      • Box
      • Cup
      • Cap
      • Sum
      • Category
      • Functor
    • pivotal
      • Ob
      • Ty
      • Diagram
      • Box
      • Cup
      • Cap
      • Category
      • Functor
    • ribbon
      • Diagram
      • Box
      • Cup
      • Cap
      • Braid
      • Category
      • Functor
    • compact
      • Diagram
      • Box
      • Cup
      • Cap
      • Swap
      • Category
      • Functor
    • frobenius
      • Ob
      • Ty
      • Diagram
      • Box
      • Cup
      • Cap
      • Swap
      • Spider
      • Category
      • Functor
    • hypergraph
      • Hypergraph
      • pushout
    • discopy.interaction
      • Ty
      • Diagram
      • NamedGeneric
      • Int
  • semantics
    • python
      • Ty
      • Function
      • exp
      • tuplify
      • untuplify
      • is_tuple
    • matrix
      • Matrix
      • Backend
      • NumPy
      • JAX
      • PyTorch
      • TensorFlow
      • backend
      • set_backend
      • get_backend
    • tensor
      • Dim
      • Tensor
      • Functor
      • Diagram
      • Box
      • Swap
      • Cup
      • Cap
      • Spider
      • Sum
      • Bubble
  • quantum
    • channel
      • CQ
      • Channel
      • Functor
      • C
      • Q
    • circuit
      • Ob
      • Digit
      • Qudit
      • Ty
      • Circuit
      • Box
      • Sum
      • Swap
      • Functor
      • index2bitstring
      • bitstring2index
    • gates
      • SelfConjugate
      • AntiConjugate
      • Discard
      • MixedState
      • Measure
      • Encode
      • QuantumGate
      • ClassicalGate
      • Copy
      • Match
      • Digits
      • Bits
      • Ket
      • Bra
      • Controlled
      • Parametrized
      • Rotation
      • Rx
      • Ry
      • Rz
      • CU1
      • CRz
      • CRx
      • Scalar
      • MixedScalar
      • Sqrt
      • sqrt
      • scalar
    • ansatze
      • IQPansatz
      • Sim14ansatz
      • Sim15ansatz
    • zx
      • Diagram
      • Box
      • Swap
      • Spider
      • Z
      • Y
      • X
      • Scalar
    • discopy.quantum.tk
      • Circuit
      • to_tk
      • from_tk
    • discopy.quantum.pennylane
      • PennyLaneCircuit
      • tk_op_to_pennylane
      • extract_ops_from_tk
      • get_post_selection_dict
      • to_pennylane
  • grammar
    • thue
      • Word
      • Rule
    • cfg
      • Tree
      • Rule
      • Word
      • Id
      • Operad
      • Algebra
    • categorial
      • Diagram
      • Box
      • Word
      • FA
      • BA
      • FC
      • BC
      • FX
      • BX
      • Functor
      • cat2ty
      • tree2diagram
    • pregroup
      • Diagram
      • Box
      • Cup
      • Cap
      • Swap
      • Word
      • Category
      • Functor
      • eager_parse
      • brute_force
    • dependency
      • from_spacy
  • drawing
    • legacy
      • Node
      • Backend
      • TikzBackend
      • MatBackend
      • Equation
      • diagram2nx
    • grid
      • Cell
      • Wire
      • Grid

Notebooks

  • What is a diagram?
  • QNLP Tutorial
  • Diagrammatic Differentiation
  • Categories for Linguistics
  • Categories for Quantum

Extra

  • Talks
  • Blogs
  • Publications
  • Bibliography
  • .rst

Functor

Contents

  • Functor

Functor#

class discopy.compact.Functor(ob=None, ar=None, dom=None, cod=None)[source]#

Bases: discopy.symmetric.Functor, discopy.ribbon.Functor

A compact functor is both a symmetric functor and a ribbon functor.

Parameters:
  • ob (Mapping[pivotal.Ty, pivotal.Ty]) – Map from atomic pivotal.Ty to cod.ob.

  • ar (Mapping[Box, Diagram]) – Map from Box to cod.ar.

  • cod (Category) – The codomain of the functor.

  • dom (T) –

previous

Category

next

frobenius

Contents
  • Functor

© Copyright 2019, DisCoPy.