Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing users to add new operators #276

Open
lkct opened this issue Oct 7, 2024 · 1 comment
Open

Allowing users to add new operators #276

lkct opened this issue Oct 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@lkct
Copy link
Member

lkct commented Oct 7, 2024

Currently, end-users cannot add a new circuit operator, as it involves modifying (instead of inheriting) some classes in the library. The original motivation is that adding a new operator requires more understanding of the internals of the library and should be done as a dev.

However, it would still be great if we allow users to do so. E.g. to implement Fisher Divergence, the current version of cirkit is still not enough -- we lack a "sum operator" for the inner product, which should be easy to impl, but still impossible with only user code.

cc @loreloc

@lkct lkct added the enhancement New feature or request label Oct 7, 2024
@lkct
Copy link
Member Author

lkct commented Oct 7, 2024

Some premature idea:
Use more "registries" so that the classes are switchable by registering a subclass.

Meanwhile, we have registry override implemented, which might be useful, e.g.

def multiply(sc1: Circuit, sc2: Circuit, registry: OperatorRegistry | None = None) -> Circuit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant