-
Notifications
You must be signed in to change notification settings - Fork 13
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
Bracket aliases do not load properly #3
Comments
That is weird that the [esc]ket[esc] input alias did not work for you, because the input alias for Ket[] and Bra[] are built-in in Mathematica. BernDirac.wl does not have anything to do with defining the input alias of Ket[] and Bra[]. Perhaps try doing I am on Mathematica version 12.3 on Windows, and never had any issues with the input alias for either Bra[] or Ket[]. In fact, even without loading BernDirac.wl, you should be able to access these input aliases since they are built-in. |
It looks like it is a Mathematica problem. I quit the kernel and did a ClearAll just in case and (without loading your example) and [esc]ket[esc] does not work and Options[SelectedNotebook[], InputAliases] shows the Join error. I send a bug to Mathematica and I'll let you know what they say. |
I received response from Mathematica support. They could not reproduce the error I was having with bra/ket on macOS on Apple silicon. They suggested that I wipe the config files for Mathematica and Wolfram... there are four of them in Library. I did that and the problem went away, the templates for bra and ket worked. I don't know what put the config files in a bad state, it may have been loading BernDirac.wl. That's the only code I have used that uses bra and ket. I should retry it to confirm that BernDirac was the source of the error but I won't do that for a while. If it is the problem I'd have to clear the Mathematica config again, which means I'd need to reactivate Mathematica, which leads to a license already in use error, which requires a call to Wolfram support to clear things up. But when I get a break I'll will do that. |
I had time to try loading BernDirac.wl into a clean configuration. Now the templates for bra and ket work just fine, so I don't know what corrupted my config. However did run into another problem. The DirectForm function generates some errors in the BernDirac_examples.nb notebook. Specifically in some cases it generates and argument count error in the KroneckerProduct function. I can't attach an .nb file but you can download my example from here https://danal-temp.s3.amazonaws.com/braketfail2.nb Running your example files will produce the error on my machine too. The errors that are produced look like this: KroneckerProduct::argmu: KroneckerProduct called with 1 argument; 2 or more arguments are expected. Thread::tdlen: Objects of unequal length in {{|0[RightAngleBracket],0},{0,|0[RightAngleBracket]}}+{[Alpha] |1[RightAngleBracket]} cannot be combined. Note that I am running on Apple silicon, not Intel, Mathematica version 12.3.1.0. In any case for what I am going to be doing I just need to basic bra ket templates to work. Thanks again for making this code available. Dan |
Yes, I am aware of that bug. It happens when |
Thanks
Dan
Sent from ProtonMail for iOS
…On Wed, Sep 22, 2021 at 2:29 PM, bernwo ***@***.***> wrote:
Yes, I am aware of that error. It happens when DiracForm[] is used on vectors/matrices that only have Hilbert space of a single qubit. It works if you use it on larger vectors/matrices. I am working on a fix.
—
You are receiving this because you authored the thread.
Reply to this email directly, [view it on GitHub](#3 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFNZKBRVHKXM7IPDJK5WI53UDIN75ANCNFSM5EIGNTBA).
Triage notifications on the go with GitHub Mobile for [iOS](https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or [Android](https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
|
Hi, the bugfix has been pushed to the Additionally, I would like to point to a feature of |
Thanks
Dan
Sent from ProtonMail for iOS
…On Wed, Sep 22, 2021 at 2:54 PM, bernwo ***@***.***> wrote:
Hi, the bugfix has been pushed to the main branch.
Additionally, I would like to point to a feature of Diracform which I haven't the time to write docstrings for.
Namely, you can change from the default computational basis to the X basis representation like so: DiracForm[Ket[0, 1], "Basis" -> {"X", "Z"}]. This outputs dirac notation where the first (left) qubit is shown in the X basis while the second (right) is shown in the Z basis.
—
You are receiving this because you authored the thread.
Reply to this email directly, [view it on GitHub](#3 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFNZKBUJJCHSRHEVVL7GYRLUDIQ6FANCNFSM5EIGNTBA).
Triage notifications on the go with GitHub Mobile for [iOS](https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or [Android](https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
|
Thank's for putting together this package, it will be very useful.
But the Braket package doesn't seem to add aliases properly in version 12.3.1.0 on macOS with a machine using Apple silicon (i.e. Apple's ARM processor)
To Reproduce
Quit the current kernel and then Run the notebook below with the correct path for the notebook. This notebook uses Get to load the example program. The ket alias doesn't work.
The notebook uses Options[SelectedNotebook[], InputAliases] so see the aliases that have been loaded. It looks like there is a Join that fails for some reason that I don't understand.
Expected behavior
[esc]ket[esc] should work
Screenshots
Git doesn't support uploading .nb files so here is the plain text for it
Get["/Users/danielsullivan/Dropbox/My Mac
(Daniels-MacBook-Pro.local)/Downloads/BernDirac-main/BernDirac.wl"]
Options[SelectedNotebook[], InputAliases]
And this is the error that appears
Join::incpt: Incompatible elements in Join[<|intt->RowBox[{[Integral],RowBox[{[SelectionPlaceholder],RowBox[{[DifferentialD],[Placeholder]}]}]}],dintt->RowBox[{SubsuperscriptBox[[Integral],[SelectionPlaceholder],[Placeholder]],RowBox[{[Placeholder],RowBox[{[DifferentialD],[Placeholder]}]}]}],rintt->RowBox[{UnderscriptBox[[Integral],RowBox[{[SelectionPlaceholder],[Element],[Placeholder]}]],[Placeholder]}],<<42>>,cS->TemplateBox[{},CombinatorS],cW->TemplateBox[{},CombinatorW],cY->TemplateBox[{},CombinatorY]|>,{<<1>>},{<<1>>}] cannot be joined.
The text was updated successfully, but these errors were encountered: