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

obey mul! convention #37

Open
Roger-luo opened this issue Feb 21, 2022 · 0 comments
Open

obey mul! convention #37

Roger-luo opened this issue Feb 21, 2022 · 0 comments

Comments

@Roger-luo
Copy link
Member

Roger-luo commented Feb 21, 2022

currently, because of all the routines we are interested in are unitaries, we treat the input state as the same as the output state which is true for quantum circuits. However, recently we find these routines are also useful for simulating hamiltonians in ODE solvers when the parameters are local/individual which as a result the output state will not be the same as the input state since it will be the intermediate difference in the ODE solver.

This is already hard to change on YaoArrayRegister side, so let's change the convention of broutine! etc. here to assume the input and output can be different (while in most cases they are the same).

e.g as a result operations like swap rows of a vector will be

tmp = input[I]
output[I] = input[J]
output[J] = tmp

which handles the case input === output but also handles the case input !== output, and it is preferred to have a factor option in our broutine! which make it more similar to a standard matrix multiplication but in the subspace and will help to avoid an extra broadcast! when multiplying the factors of a hamiltonian

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

No branches or pull requests

1 participant