Skip to content

Add Cup/Cap to channel to fix function syntax #140

Description

@mateuszkupper

Add this to core.Channel:

class Cup(frobenius.Cup, Channel):
    """
    A frobenius cup is a compact cup in a frobenius diagram.

    Parameters:
        left (Ty) : The atomic type.
        right (Ty) : Its adjoint.
    """
    __ambiguous_inheritance__ = (frobenius.Cup, )


class Cap(frobenius.Cap, Channel):
    """
    A frobenius cap is a compact cap in a frobenius diagram.

    Parameters:
        left (Ty) : The atomic type.
        right (Ty) : Its adjoint.
    """
    __ambiguous_inheritance__ = (frobenius.Cap, )
    
Diagram.cup_factory = Cup
Diagram.cap_factory = Cap

Map to the tensor.Cup and tensor.Cap from Discopy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions