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

fix #191: too restrictive typeassert for MixedDestabilizer #366

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Fe-r-oz
Copy link
Contributor

@Fe-r-oz Fe-r-oz commented Sep 22, 2024

This now works and all the test passes as well:

julia> random_destabilizer(5,6) |> stabilizerview |> MixedDestabilizer
๐’Ÿโ„ฏ๐“ˆ๐“‰๐’ถ๐’ทโ”โ”
+ Z_____
+ _Z____
+ __Z___
+ ___Z__
+ _____X
๐’ณโ‚—โ”โ”โ”โ”โ”โ”
+ ZZZZX_
๐’ฎ๐“‰๐’ถ๐’ทโ”โ”โ”โ”
+ XZ_ZZ_
- ZX__Z_
+ __YZZ_
+ Z_ZXZ_
+ _____Z
๐’ตโ‚—โ”โ”โ”โ”โ”โ”
+ ____Z_

The JET errors does not increase as well. Hopefully, this is plausible.

  • The code is properly formatted and commented.
  • Substantial new functionality is documented within the docs.
  • All new functionality is tested.
  • All of the automated tests on github pass.

@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Sep 23, 2024

The PR is ready for review. Thank you!

P.S. My bad for the rebase. Initially, I had used : after 191 in commit message which didn't pushed the issue to appear in Development. However, I noticed simply using #issue can make the issue appear in Development. So, I did the rebase using reword to remove : in hash191: . But the issue still didn't appear in Development...

@Krastanov Krastanov self-requested a review September 26, 2024 21:13
Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate why this is necessary? Maybe add tests that would have failed without this change?

@Krastanov
Copy link
Member

The proper fix for this probably requires better parameterization of the input argument. The issue is that the following T is not what is preserved:

MixedDestabilizer(::Stabilizer{T}) where {T}

Rather what is preserved is the T in here:

MixedDestabilizer(::Stabilizer{Tableau{P, <:AbstractMatrix{T}}}) where {P, T}

Maybe we should define eltype for these guys.

eltype(::Stabilizer{Tableau{P, <:AbstractMatrix{T}}}) where {P, T} = T

@Krastanov Krastanov marked this pull request as draft September 26, 2024 21:23
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

Successfully merging this pull request may close these issues.

2 participants