Skip to content

Implementing an operator with an absolute value #1668

Answered by PhilipVinc
waleed-sh asked this question in Q&A
Discussion options

You must be logged in to vote

I see, so if I understand correctly, in a sense, you have a 'standard' operator $$\hat{V}$$ , and you want to define a new operator $$\tilde V $$ which is defined such that

$$\langle\alpha|\tilde V |\beta\rangle = |\langle\alpha|V |\beta\rangle| $$

Is that correct?

In that case... I'm afraid you won't be able to use built-in netket operators, as they only support standard operator addition and multiplication (by other operators or scalars).

You can hack your way through this, though it won't be trivial.
You need to modify _get_conn_padded, which returns matrix elements and connected elements, such that the matrix elements are the absolute value.

If V had only a single term and was not a s…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@waleed-sh
Comment options

@PhilipVinc
Comment options

Answer selected by waleed-sh
@PhilipVinc
Comment options

@waleed-sh
Comment options

@PhilipVinc
Comment options

@waleed-sh
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
2 participants