Giter VIP home page Giter VIP logo

bernwo / berndirac Goto Github PK

View Code? Open in Web Editor NEW
61.0 2.0 13.0 245 KB

A Mathematica package for performing calculations involving matrices/vectors in the Dirac notation which is usually used in quantum mechanics/quantum computing.

License: GNU General Public License v3.0

Mathematica 100.00%
wolfram-mathematica mathematica-package quantum quantum-mechanics quantum-computing dirac-notation linear-algebra braket braket-notation wolfram-language

berndirac's Introduction

berndirac's People

Contributors

bernwo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

berndirac's Issues

projectors in exponentials

FIrst of all, thanks a lot for the package. It seems to work very well and it's really simple to use.

I think the template is too much :) , so I will just freely write all the necessary info:

I'm on Mathematica 12.2 on MacOS Big Sur, and I'm trying to simplify a procedure I have to compute by hand every time. For the simplest parts it works well, for example

1/Sqrt[2] Sum[Exp[I i \[Phi][0]] Ket[i], {i, 0, s}]

gives correctly

{{1/Sqrt[2]}, {1/Sqrt[2]}}

as calculated by hand. But when I put a projector in an exponential:

Exp[I Pi Ket[1] . Bra[1] ]

it gives

{{1, 1}, {1, -1}}

where I think it's supposed to give

{{1, 0}, {0, -1}}

because it reduces to an Id[2x2] - 2|1><1|, so there should be zeros in the nondiagonal places.

$Failed error in Mathematica 13.3.0.0

I'm using Mathematica 13.3.0.0.

I've downloaded the wl file to C:\Users\ianww\Documents\Mathematica\BernDirac.wl

I run:

ClearAll["Global`*"]
Get["C:\\Users\\ianww\\Documents\\Mathematica\\BernDirac.wl"]

I try (using esc ket esc to create the ket operator):

image

but I get a failed error:

$Failed

I also get the error if I comment out //MatrixForm:

image
$Failed

I get the same error if I try to run your example file.

I've also tried using Import rather than Get:

Import["C:\\Users\\ianww\\Documents\\Mathematica\\BernDirac.wl", "Rules"]

and it shows the file is loading ok because I get a comprehensive list of rules. However, the same $Failed error occurs.

Do you know if your wl is compatible with Mathematica 13.3.0.0? Or could there be some other cause that I've missed?

Bracket aliases do not load properly

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.