Skip to content

obey mul! convention #37

@Roger-luo

Description

@Roger-luo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions