quantum-flytrap / quantum-tensors Goto Github PK
View Code? Open in Web Editor NEWQuantum Tensors - NPM package for sparse matrix operations for quantum information and computing
Home Page: https://quantum-flytrap.github.io/quantum-tensors/
Quantum Tensors - NPM package for sparse matrix operations for quantum information and computing
Home Page: https://quantum-flytrap.github.io/quantum-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 ?
Both fromLighter and fromDenser in Ops.ts seem to be the same function.
(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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.