Skip to content

Commit 074727c

Browse files
README.md & GitHub Wiki (#95)
* `README.md` structure/skeleton * Minor typo * Changed title 6 - II * New section 'Tutorials & Examples' * Images in documentation without Imgur * Empty commit * Minor changes to README * Updated README structure to match wiki structure * Added references to the wiki * 'About Quantum Computing' in progress * Displaying screenshots in the wiki * Screenshots of node's appearances * Screenshots of node palette * Input & output images for wiki * Revisited `resources` folder structure * Update README * Update title * `README.md` Install section * Update 'Quantum' nodes sections * Removed unecessary indent * Updated 'Install' section * 'Install' section update * Update 'Quantum Computing' section * Update README structure and unnecessary blank lines * 'Entanglement' section * Update 'Entanglement' section * Update 'Entanglement' * Updated Quantum Circuit 'Details' section
1 parent 43f8d28 commit 074727c

File tree

95 files changed

+795
-650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+795
-650
lines changed

README.md

Lines changed: 125 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,144 @@
1-
# node-red-quantum
1+
# node-red-quantum <!-- omit in toc -->
22

33
[![platform](https://img.shields.io/badge/platform-Node--RED-red)](https://nodered.org)
44
[![CI Status](https://img.shields.io/github/workflow/status/louislefevre/node-red-contrib-quantum/Node.js%20CI)](https://github.com/louislefevre/node-red-contrib-quantum/actions/workflows/node.js.yml)
55
[![NPM](https://img.shields.io/npm/v/node-red-contrib-quantum)](https://www.npmjs.com/package/node-red-contrib-quantum)
66
[![Node](https://img.shields.io/node/v/node-red-contrib-quantum)](https://nodejs.org/en/)
77

8+
89
**Node-RED Quantum** provides a set of nodes to build and run quantum computing algorithms within Node-RED.
910

1011
Please be aware that this is a **development version** of Node-RED Quantum, it is still a work in progress and the code is unstable. A full production-ready release will be published soon.
1112

12-
This module is a user-friendly library that is suitable to new quantum computing users thanks to its extensive documentation. It was designed to facilitate the integration of quantum algorithms within classical programs and is fully scalable since all the elemental quantum operations are included.
13+
This module is a user-friendly library that is suitable for new quantum computing users thanks to its extensive documentation. It was designed to facilitate the integration of quantum algorithms within classical programs and is fully scalable since all the elemental quantum operations are included.
1314

14-
This Node-RED library was developed in the context of a UCL IXN partnership with IBM. Defined and arranged by IBM, the project was allocated to students from UCL's computer science department as part of their Master's thesis.
15+
This Node-RED library was developed in the context of a [UCL IXN](https://www.ucl.ac.uk/computer-science/collaborate/ucl-industry-exchange-network-ucl-ixn) partnership with [IBM](https://www.ibm.com/uk-en). Defined and arranged by IBM, the project was allocated to students from UCL's computer science department as part of their Master's thesis.
1516

1617
For the latest changes, please read the [CHANGELOG](CHANGELOG.md).
1718

1819
For more details on the authors, please read the [AUTHORS](AUTHORS) file.
1920

2021
For information on how to contribute, please read the [CONTRIBUTING](CONTRIBUTING.md) guidelines.
2122

22-
![Quantum Circuit example](./images/QuantumRandomNumber.png)
2323

24-
## Prerequisites
25-
Node-RED Quantum requires at minimum [Node-RED 1.0](https://nodered.org) and [Python 3](https://www.python.org/).
24+
![Quantum Circuit example](./resources/quantum-circuit-examples/quantum-random-number.png)
25+
26+
<br /><br />
27+
28+
# Table of contents <!-- omit in toc -->
29+
- [Pre-requisites](#pre-requisites)
30+
- [Install](#install)
31+
- [About Quantum Computing](#about-quantum-computing)
32+
- [*'Quantum'* nodes - Building quantum circuits](#quantum-nodes---building-quantum-circuits)
33+
- [*'Quantum Algorithms'* nodes - Leveraging quantum computing](#quantum-algorithms-nodes---leveraging-quantum-computing)
34+
- [Tutorials & Examples](#tutorials--examples)
35+
36+
<br />
37+
38+
# Pre-requisites
39+
Node-RED Quantum requires at minimum [Node.js 12.0.0](https://nodejs.org/en/), [Node-RED 1.0](https://nodered.org) and [Python 3](https://www.python.org/).
40+
41+
<br />
42+
43+
# Install
44+
45+
1. In the terminal of your machine, install **Node-RED** by executing the command:
46+
`sudo npm install -g --unsafe-perm node-red`.
47+
48+
2. Once **Node-RED** has been installed, start the application by entering the command `node-red` in the terminal.
49+
50+
3. Navigate to **Node-RED** by following the IP address returned in the terminal. This will usually be `http://127.0.0.1:1880/`.
51+
52+
4. In **Node-RED**, navigate to the **Palette Manager** (top-right corner), select **Install** and search for *'quantum'*, as depicted below.
53+
54+
5. Install the **node-red-contrib-quantum** package. Once installed, it will show as quantum nodes in the **Palette** (on the left of the Node-RED editor). Please note that this installation may take a few minutes, as it needs to install the Python virtual environment required for executing the nodes.
55+
56+
![Node-RED palette manager](./resources/installation-guide/palette-manager.png)
57+
58+
<br />
59+
60+
# About Quantum Computing
61+
62+
## Qubit State <!-- omit in toc -->
63+
64+
A qubit is the same to a quantum computer than what a bit is to a classical computer: the smallest unit of information.<br />
65+
<a href="https://qiskit.org/textbook/ch-states/representing-qubit-states.html#statevectors"> Classical vs Quantum bits - Qiskit textbook</a>
66+
<br /><br />
67+
The <b>Bloch sphere</b> representation is considered as the most simple and ludic way to understand & visualise a qubit (see image below).
68+
In contrast with classical bits that can only be in a '0' or a '1' state, qubits can store much more information.
69+
In fact, all points on the sphere represent a different qubit state, the usual classical bit states being labelled as:
70+
<ul>
71+
<li>State 0</li>
72+
<li>State 1</li>
73+
</ul>
74+
Quantum states that are in between those 2 points are a weighted combination of the '0' and '1' states. This is called <b>superposition</b>. <br/>
75+
To set the qubit in a particular state, we operate rotations or reflections of the <b>Bloch sphere</b> while keeping the x, y and z axis unchanged.<br />
76+
<a href="https://qiskit.org/textbook/ch-states/representing-qubit-states.html#bloch-sphere-2">Bloch Sphere - Qiskit textbook</a>
77+
<br /><br />
78+
<b>Example -</b> Applying a &#960; radians rotation about the x-axis on a qubit that is in the '0 state' will put it in the '1 state'.
79+
<br/><br/>
80+
81+
<img src="./resources/quantum-computing/bloch-sphere-horizontal.png" width="750px"/><br />
82+
83+
## Qubit Measurement <!-- omit in toc -->
84+
85+
It is very important to understand that, even though a qubit can take an infinite number of states, our technology only allows us to measure '0' or '1', like on a classical bit. Since we measure and interpret a qubit state using classical machines, this can be seen as a projection of quantum computing back to classical computing: from quantum states back to binary values. <br />
86+
<a href="https://qiskit.org/textbook/ch-states/representing-qubit-states.html#rules-measurement">Qubit measurement - Qiskit textbook</a>
87+
<br /><br />
88+
This leads to probabilistic measurement results.
89+
In terms of the <b>Bloch Sphere</b>, the closest the qubit state is from the '1 state', the more likely we are to measure a '1'.
90+
<br/><br/>
91+
<b>Example -</b> If we measure a 1000 times a qubit that has a state in the x-y plane, then we will get more or less 500 '0' measurements and 500 '1' measurements.
92+
<br/><br/>
93+
<b>Careful -</b> The act of measuring a qubit collapses the qubit state: the state of the qubit after being measured
94+
is not representative of the qubit state before the measurement. Please measure the qubits at the end of the quantum circuit or reset them after a measurement.
95+
96+
<br />
97+
98+
## Entanglement <!-- omit in toc -->
99+
100+
Referred to as a "spooky action at a distance" by Albert Einstein, **entanglement** is a quantum phenomenon that is extremely powerful in quantum computing. It is a form of connection that can exist between any number of qubits. Here we will illustrate **entanglement** between two qubits.
101+
<br /><br />
102+
Two qubits are said to be **entangled** when their relative states rely on each other. In other words, changing or knowing the state of one qubit can change the state of the other qubit. This connection is independent of time and space: the two qubits can be miles appart and the connection will still be instantaneous.
103+
<br /><br />
104+
In practice, **entanglement** arises when the operation of a gate on a qubit is conditional on the state of another qubit (similar to an `if` block in classical computing). These gates are often referred to as [multi-qubits quantum gates](https://github.com/louislefevre/node-red-contrib-quantum/wiki/Quantum-Gate-Nodes/#multi-qubits-quantum-gates).
105+
<br /><br />
106+
<b>Example -</b> A CNOT gate applies a NOT gate (0 &#8594; 1 & 1 &#8594; 0) to the 'target' qubit **if and only if** the 'control' qubit is in the '1' state.
107+
<br /><br />
108+
Now, let's assume that the 'control' qubit is in a <b>superposition</b> state (25% '0' / 75% '1'), while the 'target' qubit is in the '0' state.<br />
109+
Then, the **combined** state of the 2 qubits after applying the CNOT gate will be:
110+
<ul>
111+
<li>'00' with 25% probability</li>
112+
<li>'11' with 75% probability</li>
113+
</ul>
114+
The 2 qubits are now <b>entangled</b>. If we measure one of them to be in the '1' state, then we know that other qubit will be in the '1' state as well.
115+
<br /><br />
116+
<a href="https://qiskit.org/textbook/ch-gates/multiple-qubits-entangled-states.html#entangled">Entanglement - Qiskit textbook</a>
117+
<br /><br />
118+
119+
# *'Quantum'* nodes - Building quantum circuits
120+
121+
122+
* [Circuit Initialisation nodes](https://github.com/louislefevre/node-red-contrib-quantum/wiki/Circuit-Initialisation-Nodes)
123+
124+
* [Qubit Control nodes](https://github.com/louislefevre/node-red-contrib-quantum/wiki/Qubit-Control-Nodes)
125+
126+
* [Quantum Gate nodes](https://github.com/louislefevre/node-red-contrib-quantum/wiki/Quantum-Gate-Nodes)
127+
128+
* [Circuit Output nodes](https://github.com/louislefevre/node-red-contrib-quantum/wiki/Circuit-Output-Nodes)
129+
130+
<br/>
131+
132+
For detailed information on how to use each node, please head to the [Node-RED Quantum wiki](https://github.com/louislefevre/node-red-contrib-quantum/wiki).
133+
134+
<br />
135+
136+
# *'Quantum Algorithms'* nodes - Leveraging quantum computing
137+
138+
For detailed information on how to use each node, please head to the [Node-RED Quantum wiki](https://github.com/louislefevre/node-red-contrib-quantum/wiki).
139+
140+
<br />
141+
142+
# Tutorials & Examples
143+
144+
<br />
Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,61 @@
11
<script type="text/html" data-help-name="barrier">
2-
<p>
3-
This node can be used to control the order in which quantum gates are applied accross multiple qubits.
4-
It can also be used to visually differentiate qubits objects when they flow through the same wire.
5-
</p>
6-
<p>
7-
The barrier will wait until a specified number of qubit objects have arrived to the node, before they are sent further
8-
along in the quantum circuit.
9-
<br/><br/>
10-
To do this, open the node properties and select the number of qubits objects
11-
that the barrier node will be expecting, before allowing them to continue running.
12-
<br/><br/>
13-
<a href="https://qiskit.org/documentation/stubs/qiskit.circuit.QuantumCircuit.html#qiskit.circuit.QuantumCircuit.barrier">Barrier - Qiskit documentation</a>
14-
</p>
15-
16-
<h3>Inputs</h3>
17-
<dl class="message-properties">
18-
<dt>payload
19-
<span class="property-type">object</span>
20-
</dt>
21-
<dd>The qubit objects for which the execution must be controlled.</dd>
22-
<dt class="optional">topic
23-
<span class="property-type">string</span>
24-
</dt>
25-
<dd>"Quantum Circuit"</dd>
26-
</dl>
27-
28-
<h3>Outputs</h3>
29-
<dl class="message-properties">
2+
<p>
3+
This node can be used to control the order in which quantum gates are applied accross multiple qubits.
4+
It can also be used to visually differentiate qubits objects when they flow through the same wire.
5+
</p>
6+
<p>
7+
The barrier will wait until a specified number of qubit objects have arrived to the node, before they are sent further
8+
along in the quantum circuit.
9+
<br/><br/>
10+
To do this, open the node properties and select the number of qubits objects
11+
that the barrier node will be expecting, before allowing them to continue running.
12+
<br/><br/>
13+
<a href="https://qiskit.org/documentation/stubs/qiskit.circuit.QuantumCircuit.html#qiskit.circuit.QuantumCircuit.barrier">Barrier - Qiskit documentation</a>
14+
<br /><br />
15+
</p>
16+
17+
<h3>Inputs</h3>
18+
<dl class="message-properties">
3019
<dt>payload
3120
<span class="property-type">object</span>
3221
</dt>
33-
<dd>The same qubit objects that were received as input.</dd>
22+
<dd>The qubit objects for which the execution must be controlled.</dd>
3423
<dt class="optional">topic
3524
<span class="property-type">string</span>
3625
</dt>
3726
<dd>"Quantum Circuit"</dd>
38-
</dl>
39-
27+
</dl>
28+
29+
<h3>Outputs</h3>
30+
<dl class="message-properties">
31+
<dt>payload
32+
<span class="property-type">object</span>
33+
</dt>
34+
<dd>The same qubit objects that were received as input.</dd>
35+
<dt class="optional">topic
36+
<span class="property-type">string</span>
37+
</dt>
38+
<dd>"Quantum Circuit"</dd>
39+
</dl>
40+
41+
<br />
42+
<h3>Details</h3>
4043
<br />
41-
<h3>Details</h3>
42-
<br />
43-
<p>
44-
Qubit objects can be generated from:
45-
<ul>
46-
<li><i>Quantum Circuit</i> node in 'Bits only' mode.</li>
47-
<li><i>Quantum Register</i> node along with <i>Quantum Circuit</i> in 'Register' mode.</li>
48-
</ul>
49-
Unless specified, qubits are initialised in the 0 state.
50-
<br /><br />
51-
<b>
52-
For a brief summary of the main quantum computing concepts, please refer to the
53-
<i>Details</i> section of the <i>Quantum Circuit</i> node.
54-
</b>
55-
<br /><br />
56-
<a href="https://flows.nodered.org/node/node-red-contrib-quantum">Node-RED Quantum documentation - Node-RED website</a><br/>
57-
<a href="https://www.npmjs.com/package/node-red-contrib-quantum">Node-RED Quantum documentation - NPM website</a>
58-
<br /><br />
59-
</p>
60-
</script>
44+
<p>
45+
Qubit objects can be generated from:
46+
<ul>
47+
<li><i>Quantum Circuit</i> node in 'Bits only' mode.</li>
48+
<li><i>Quantum Register</i> node along with <i>Quantum Circuit</i> in 'Register' mode.</li>
49+
</ul>
50+
Unless specified, qubits are initialised in the 0 state.
51+
<br /><br />
52+
<b>
53+
For a brief summary of the main quantum computing concepts, please refer to the
54+
<i>Details</i> section of the <i>Quantum Circuit</i> node.
55+
</b>
56+
<br /><br />
57+
<a href="https://flows.nodered.org/node/node-red-contrib-quantum">Node-RED Quantum documentation - Node-RED website</a><br/>
58+
<a href="https://www.npmjs.com/package/node-red-contrib-quantum">Node-RED Quantum documentation - NPM website</a>
59+
<br /><br />
60+
</p>
61+
</script>

0 commit comments

Comments
 (0)