https://github.com/quantum-flytrap/tensor-diagrams
Tensor diagrams - Penrose graphical notation in D3.js
https://github.com/quantum-flytrap/tensor-diagrams
array d3js data-viz diagram mathematics penrose quantum tensor
Last synced: over 1 year ago
JSON representation
Tensor diagrams - Penrose graphical notation in D3.js
- Host: GitHub
- URL: https://github.com/quantum-flytrap/tensor-diagrams
- Owner: Quantum-Flytrap
- License: mit
- Created: 2021-06-15T11:21:41.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T14:23:54.000Z (over 3 years ago)
- Last Synced: 2025-03-29T12:17:15.758Z (over 1 year ago)
- Topics: array, d3js, data-viz, diagram, mathematics, penrose, quantum, tensor
- Language: TypeScript
- Homepage:
- Size: 226 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tensor diagrams - Penrose graphical notation in D3.js
[](https://badge.fury.io/js/tensor-diagrams)


[](https://twitter.com/QuantumFlytrap)
A package for creating visual tensor diagrams using [Penrose graphical notation](https://en.wikipedia.org/wiki/Penrose_graphical_notation) in D3js. For machine learning, deep learning, quantum computing, quantum information, and other array operations. By [Piotr Migdał](https://p.migdal.pl/) and [Claudia Zendejas-Morales](https://claudiazm.xyz/) from [Quantum Flytrap](https://quantumflytrap.com/).
A simple live version: https://jsfiddle.net/stared/60ndm3co/.
A work-in-progress article about Tensor Diagrams in Deep Learning, and its source .
Inspirations include:
* [tensornetwork.org/diagrams](http://tensornetwork.org/diagrams/)
* [Matrices as Tensor Network Diagrams](https://www.math3ma.com/blog/matrices-as-tensor-network-diagrams) by Tai-Danae Bradley
* [Drawing Trace Diagrams with TikZ](http://elishapeterson.wikidot.com/tikz:diagrams) by Elisha Peterson
* Piotr's longstanding interest in data visualization of array operations
* [⟨𝜑|𝜓⟩.vue - a Vue-based visualization of quantum states and operations](https://github.com/Quantum-Flytrap/bra-ket-vue)
* [Simple diagrams of convoluted neural networks](https://p.migdal.pl/2018/09/15/simple-diagrams-deep-learning.html)
* [Symmetries and self-similarity of many-body wavefunctions](https://arxiv.org/abs/1412.6796)
If you want to use tensors in the browser, you may be looking for the [Quantum-Flytrap/quantum-tensors](https://github.com/Quantum-Flytrap/quantum-tensors) NPM package. If you are looking to visualize complex vectors and operators (especially for quantum computing), see [https://github.com/Quantum-Flytrap/bra-ket-vue](https://github.com/Quantum-Flytrap/bra-ket-vue).
## Local setup
Created using a NPM TypeScript frontend boilerplate [metachris/typescript-boilerplate](https://github.com/metachris/typescript-boilerplate/), which uses [esbuild](https://esbuild.github.io/), and is described in detail in [Blog post: Starting a TypeScript Project in 2021](https://www.metachris.com/2021/03/bootstrapping-a-typescript-node.js-project/).
```bash
# Clone the repository
git clone git@github.com:Quantum-Flytrap/tensor-diagrams.git
cd tensor-diagrams
# Install dependencies
yarn install
# Now you can run various yarn commands:
yarn lint
yarn test
yarn build-all
yarn esbuild-browser
yarn docs
```
## Feedback
The easiest feedback is by opening a [GitHub Issue](https://github.com/Quantum-Flytrap/tensor-diagrams/issues).