Coder Social home page Coder Social logo

quantum-flytrap / quantum-tensors Goto Github PK

View Code? Open in Web Editor NEW
52.0 5.0 11.0 1.66 MB

Quantum Tensors - NPM package for sparse matrix operations for quantum information and computing

Home Page: https://quantum-flytrap.github.io/quantum-tensors/

TypeScript 99.08% JavaScript 0.92%
quantum-tensors quantum-game complex-numbers typescript quantum-computing quantum-mechanics quantum-information matrix tensor vector

quantum-tensors's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar

quantum-tensors's Issues

Extending jest to compare vectors and tensors

There is no way to use toBeCloseTo for objects.

I try to add new tests, but I fail.

I tried to follow the example from the official documentation, https://jestjs.io/docs/en/expect.html#expectextendmatchers, but it does not work.

Similarly, https://stackoverflow.com/questions/43667085/extending-third-party-module-that-is-globally-exposed looks close, but I after expect('str').myMatcher('str') I get an error: Expected 2 arguments, but got 1. An argument for 'expected' was not provided..

This is a longer example that might work, jestjs/jest#8295 and https://stackoverflow.com/questions/45743548/custom-matcher-in-jest, but didn't test + understand it even less than the previous example.

There were some changes in the interfaces - maybe it is about that styled-components/jest-styled-components#270 ?

Dimensions checked as types

(An idea💡)

The idea is to create Vectors and operator with types, e.g.

Vector<[x, y, pol, dir]> or operator Operator<[spin, spin], [spin, spin]>

Thay way, it would be possible to check types at the TypeScript level. It seems that in plain TS the operations are clunky, but it is possible to use:

https://github.com/ksxnodemodules/typescript-tuple/

I didn't know how to approach it, as some operations (e.g. partialDot) make the type dependent on values.

Also, for dimensions - should be also incorporate basis?

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.