Leedehai / typst-physics

physica: vectors, fields, differentials, derivatives, Dirac brakets, tensors, and more. See examples in the manual PDF.
https://github.com/Leedehai/typst-physics
MIT License
312 stars 8 forks source link

Unexpected output of iprod() #20

Closed CarrotDLaw closed 8 months ago

CarrotDLaw commented 8 months ago

As per the latest manual of physica, the behaviour of iprod() should be the one shown in the first line. However, the actual output is the one in the second line.

$
& angle.l u, v angle.r \
& iprod(u, v) \
& braket(u, v)
$
image
YDX-2147483647 commented 8 months ago

As per the latest manual of physica, the behaviour of iprod() should be the one shown in the first line.

Could you specify which is the latest manual of physica? I have checked v0.7.5 to v0.9.0

Sorry I didn't notice https://github.com/Leedehai/typst-physics/commit/94c89824cbb69d1513e49ea7ea3d0bd90f7016fd. It looks like it's unreleased yet.


And here is current implementation.

https://github.com/Leedehai/typst-physics/blob/94c89824cbb69d1513e49ea7ea3d0bd90f7016fd/physica.typ#L209-L212

CarrotDLaw commented 8 months ago

The manual of 0.9.0 is as follows.

image
YDX-2147483647 commented 8 months ago

Well, I downloaded the manual from https://github.com/Leedehai/typst-physics/releases, and I guess you downloaded it from the repo…

CarrotDLaw commented 8 months ago

I did, indeed. So I will really close this issue.

Leedehai commented 8 months ago

Yeah thanks for pointing it out.. I'm working on some changes and release as 0.9.1. That iprod() change (https://github.com/Leedehai/typst-physics/commit/94c89824cbb69d1513e49ea7ea3d0bd90f7016fd) is part of that future release, since in math inner product takes the form of <u, v> more often. The <u|v> form can be obtained from the braket() function.

Leedehai commented 8 months ago

Update: I updated to 0.9.1 and made a PR to upload it to the official package repo: https://github.com/typst/packages/pull/304

After that PR is merged, the package will be available for Typst's auto-loading and the web app.

Thanks again for catching this :)