Skip to content

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

@mateuszkupper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions