QuantumBFS / Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.
https://yaoquantum.org
Other
928 stars 123 forks source link

Moved `qubit_type` to `YaoAPI` #462

Closed jlbosse closed 1 year ago

jlbosse commented 1 year ago

The title says it all. Only open question from me is, whether we want to export qubit_type as part of the general API of an AbstractRegister

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 90.62% and project coverage change: +0.03 :tada:

Comparison is base (dc9d152) 88.24% compared to head (61f7e72) 88.28%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #462 +/- ## ========================================== + Coverage 88.24% 88.28% +0.03% ========================================== Files 77 78 +1 Lines 4807 4822 +15 ========================================== + Hits 4242 4257 +15 Misses 565 565 ``` | [Impacted Files](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS) | Coverage Δ | | |---|---|---| | [lib/YaoAPI/src/registers.jl](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS#diff-bGliL1lhb0FQSS9zcmMvcmVnaXN0ZXJzLmps) | `0.00% <0.00%> (ø)` | | | [lib/YaoArrayRegister/src/error.jl](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS#diff-bGliL1lhb0FycmF5UmVnaXN0ZXIvc3JjL2Vycm9yLmps) | `53.06% <ø> (ø)` | | | [lib/YaoBlocks/src/YaoBlocks.jl](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS#diff-bGliL1lhb0Jsb2Nrcy9zcmMvWWFvQmxvY2tzLmps) | `100.00% <ø> (ø)` | | | [lib/YaoArrayRegister/src/register.jl](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS#diff-bGliL1lhb0FycmF5UmVnaXN0ZXIvc3JjL3JlZ2lzdGVyLmps) | `96.19% <66.66%> (+0.34%)` | :arrow_up: | | [lib/YaoArrayRegister/src/density\_matrix.jl](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS#diff-bGliL1lhb0FycmF5UmVnaXN0ZXIvc3JjL2RlbnNpdHlfbWF0cml4Lmps) | `100.00% <100.00%> (+3.57%)` | :arrow_up: | | [lib/YaoArrayRegister/src/focus.jl](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS#diff-bGliL1lhb0FycmF5UmVnaXN0ZXIvc3JjL2ZvY3VzLmps) | `90.32% <100.00%> (+0.32%)` | :arrow_up: | | [lib/YaoBlocks/src/channel/error\_channel.jl](https://codecov.io/gh/QuantumBFS/Yao.jl/pull/462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS#diff-bGliL1lhb0Jsb2Nrcy9zcmMvY2hhbm5lbC9lcnJvcl9jaGFubmVsLmps) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Roger-luo commented 1 year ago

after thinking about this a bit, and as @GiggleLiu commented here this function is only used for printing not really address the basis information (it's inside the type parameters), and assuming someone is overloading it for say rydberg it's a bit strange that qubit_type is made for basis. This is a quite vague API IMO, we should eventually get rid of it with something more general.

also, I don't think the basis is well supported in YaoBlocks, we probably shouldn't encourage people to put too much effort into building things on top of it.

jlbosse commented 1 year ago

Fair enough, I will close this then