Skip to content

design question for a custom operator #1143

Answered by PhilipVinc
dambuck asked this question in Q&A
Discussion options

You must be logged in to vote

An alternative would be to implement an operator inheriting from DiscreteOperator, like Ising:

def _flattened_kernel(

In this case you'd have to define a function (ideally numbajitted) that computes the connected elements.
As those operators correspond to a matrix, again, you cannot add new axes arbitrarily but you can flatten it yourself.

The point of not adding a new dimension is because, in general, an operator represent the matrix (X_1HX_1 + X_1 H X_2 + X_2H X_1 + X_2 H X_2 + etc...) , and not the single terms.

Replies: 3 comments 19 replies

Comment options

You must be logged in to vote
1 reply
@PhilipVinc
Comment options

Comment options

You must be logged in to vote
16 replies
@PhilipVinc
Comment options

@dambuck
Comment options

@femtobit
Comment options

femtobit Apr 6, 2022
Collaborator

@singhavishek
Comment options

@dambuck
Comment options

Answer selected by dambuck
Comment options

You must be logged in to vote
2 replies
@PhilipVinc
Comment options

@dambuck
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants