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

switch to YaoLocations #274

Closed
Roger-luo opened this issue Jan 14, 2021 · 1 comment
Closed

switch to YaoLocations #274

Roger-luo opened this issue Jan 14, 2021 · 1 comment

Comments

@Roger-luo
Copy link
Member

Roger-luo commented Jan 14, 2021

currently, we are using NTuple{N, Int} to represent locations, this is becoming more and more inconvenient when developing YaoLang and the new emulation backend BQCESubroutines:

  1. the compiler needs a special type that will be treated as a primitive type during inference, so that we can apply special rules on Locations, e.g always constant prop and unroll Locations, unlike Tuple
  2. on the emulation side, because now we can create arbitrary kernel for matrix function, NTuple can cause ambiguity when there is a matrix function like following
@broutine a_bit_general_matrix(U::NTuple{4}) = [U[1] U[2];U[3] U[4]]

so now the package YaoLocations has been widely used inside YaoLang and BQCESubroutines at low level, I'm now thinking for the sake of consistency, we should start using it from YaoBlocks, YaoArrayRegisters - this won't change the user interface, but the only low-level interface, but I think will make things much easier for future work.

@Roger-luo
Copy link
Member Author

Another issue currently we have is the ambiguity caused by instruct! (over 100 ambiguities)

I think we will not update YaoArrayRegister to YaoLocations but will just switch to a new backend later to fully use YaoLocations since this is more compatible and easier to work on

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