Skip to content

Commit 836caef

Browse files
Documentation - README & Wiki (#116)
* Internet connection requirement in IBM Quantum node docs * Quantum algos images for wiki * Documentation formatting for quantum algos nodes * README 'nodes' section * Small update * Fix typo * Update README.md - Remove unnecessary indentation and leading whitespace in TOC. - Use title case for all headings for consistency. - Remove trailing whitespace from headings for consistency. - Remove <br> tags - generally we dont want to use HTML tags in markdown, but in this case the <br> tags weren't doing anything anyway once the markdown was parsed on GitHub. - I think using a H4 header for the "Example" sections makes more sense given that each example is its own subsection, and H4 is also visibly the same as bold text. The "Example" sections should also be formatted consistently: some have the text come after "Example", whilst others have the text on the same line as "Example". - Remove repeated text from "How to Use" section list and condensed it. The large use of whitespace and line breaks makes it difficult to read, and much larger than it needs to be. - Also condensed "Rules" section, too much whitespace. * Implemented requested changes * Update README.md Co-authored-by: Louis Lefevre <[email protected]> Co-authored-by: Louis Lefevre <[email protected]>
1 parent f4b6ab4 commit 836caef

File tree

8 files changed

+58
-18
lines changed

8 files changed

+58
-18
lines changed

README.md

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ For the latest changes, please read the [CHANGELOG](CHANGELOG.md).
2525
- [Qubit Measurement](#qubit-measurement)
2626
- [Entanglement](#entanglement)
2727
- [Quantum Nodes](#quantum-nodes)
28+
- [How to Use](#how-to-use)
29+
- [Rules](#rules)
2830
- [Quantum Algorithm Nodes](#quantum-algorithm-nodes)
2931
- [Contributing](#contributing)
3032
- [Acknowledgements](#acknowledgements)
3133

3234
## Prerequisites
3335
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/). It is also advised that you start Node-RED from a Bash shell, as it is required to prepare the Python virtual environment.
3436

37+
Even though not required, some knowledge on how to use the Node-RED platfom can be useful. We recommend this [Node-RED tutorial](https://www.youtube.com/watch?v=3AR432bguOY) on YouTube.
38+
3539
## Installation
3640
1. Install Node-RED locally by following the installation instructions [here](https://nodered.org/docs/getting-started/local).
3741
2. Once Node-RED has been installed, start the application by entering the command `node-red` in the terminal.
@@ -42,6 +46,7 @@ Node-RED Quantum requires at minimum [Node.js 12.0.0](https://nodejs.org/en/), [
4246
![Node-RED palette manager](./resources/installation-guide/palette-manager.png)
4347

4448
## About Quantum Computing
49+
4550
### Qubit State
4651
A qubit is the same to a quantum computer as what a bit is to a classical computer: the smallest unit of information.
4752

@@ -53,7 +58,7 @@ Quantum states that are in between those 2 points are a weighted combination of
5358

5459
The Qiskit textbook provides more information on [classical vs quantum bits](https://qiskit.org/textbook/ch-states/representing-qubit-states.html#statevectors), as well as [bloch spheres](https://qiskit.org/textbook/ch-states/representing-qubit-states.html#bloch-sphere-2).
5560

56-
#### Example
61+
#### Example:
5762
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'.
5863
![Bloch sphere](./resources/quantum-computing/bloch-sphere-horizontal.png)
5964

@@ -66,7 +71,7 @@ The act of measuring a qubit collapses the qubit state; the state of the qubit a
6671

6772
More information on qubit measurement can be found in the [Qiskit Textbook](https://qiskit.org/textbook/ch-states/representing-qubit-states.html#rules-measurement)
6873

69-
#### Example
74+
#### Example:
7075
If we measure a qubit that has a state in the x-y plane 1000 times, then we will approximately get 500 '0' measurements and 500 '1' measurements.
7176

7277
### Entanglement
@@ -78,33 +83,66 @@ In practice, **entanglement** arises when the operation of a gate on a qubit is
7883

7984
More information on entanglement can be found in the [Qiskit Textbook](https://qiskit.org/textbook/ch-gates/multiple-qubits-entangled-states.html#entangled)
8085

81-
#### Example
86+
#### Example:
8287
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.
8388

8489
Now, let's assume that the 'control' qubit is in a **superposition** state (25% '0' / 75% '1'), while the 'target' qubit is in the '0' state. Then, the **combined** state of the 2 qubits after applying the CNOT gate will be:
85-
- '00' with 25% probability
86-
- '11' with 75% probability
90+
- '00' with 25% probability
91+
- '11' with 75% probability, (NOT gate applied)
8792

88-
The 2 qubits are now **entangled**: 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.
93+
The 2 qubits are now **entangled**: if we measure one of them to be in a specific state, then we know the other one will be in the same state.
8994

9095
## Quantum Nodes
91-
Quantum circuits can be built through the use of the *'quantum'* nodes provided by this library.
92-
- [Circuit Initialisation nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Circuit-Initialisation-Nodes)
93-
- [Qubit Control nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Qubit-Control-Nodes)
94-
- [Quantum Gate nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Gate-Nodes)
95-
- [Circuit Output nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Circuit-Output-Nodes)
96+
Node-RED Quantum includes a *'quantum'* library of nodes that can be used to build quantum circuits.
97+
98+
### How to Use
99+
The 'Quantum Circuit' node can generate a quantum circuit with qubits. The qubits will then flow through a certain set of nodes corresponding to quantum operations, or gates. Finally, all qubits must be connected to a single output node that will process the circuit and output the results.
100+
101+
The nodes are organised into 4 categories:
102+
- [Input nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Input-Nodes) (gray) are used to set up a quantum circuit and output qubits. To start, use the 'Quantum Circuit' node to generate one qubit through each output.
103+
104+
- [Qubit nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Qubit-Nodes) (blue) are used to keep track and manage qubits, such as resetting them. The 'Qubit' node receives qubits as input but does not execute any operation on it. It can be used to identify qubits, by printing some text under the node, or to rearrange the position of qubits into the editor.
105+
106+
- [Quantum Gate nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Gate-Nodes) correspond to quantum operations. When a qubit flow through a quantum gate node, the operation is executed on the qubit. There are 2 type of quantum gates:
107+
- [Singe qubit gates](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Gate-Nodes/#single-qubit-quantum-gate) (purple) receive a qubit, execute an operation, and output the qubit. The 'NOT Gate' flips the state of the qubit (0 &#8594; 1 & 1 &#8594; 0).
108+
- [Multi qubits gates](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Gate-Nodes#multi-qubits-quantum-gates) (red) receive a certain number of qubits, execute a **control operation** and output the qubits. Control operations correspond to the conditional execution of a single quantum gate. If the 'control' qubits are in the correct state, then the gate is applied on a 'target' qubit. The 'CNOT Gate', operating on 2 qubits, applies a NOT gate on the 'target' qubit if the 'control' qubit is in the '1' state.
109+
110+
- [Output nodes](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Output-Nodes) (grey) are used to process the quantum circuit and generate an output. All qubits of the quantum circuit must be connected to the same output node for it to work. The output format varies between each node, please refer to the documentation. The 'Local Simulator' node simulates a quantum computer using the local Qiskit library. It runs the quantum circuit and outputs the results.
111+
112+
### Rules
113+
1. **Do not duplicate qubits**
114+
To avoid inconsistencies, there should always be 1 instance of each qubit at all times.
115+
A node can take multiple qubits as input but only one wire should be connected to each output. To do so, always input as many qubits as the node outputs.
96116

97-
More information on quantum nodes can be found in the [Node-RED Quantum wiki](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Building-Quantum-Circuits).
117+
2. **Wait for quantum circuit to execute**
118+
Do not double-click the inject button, wait for the circuit to have finished executing before runnning it again.
119+
If such an issue occurs, please restart Node-RED.
120+
121+
| Input nodes | Qubit nodes | Single qubit gate nodes | Multi qubits gate nodes | Output nodes |
122+
| :---: | :---: | :---: | :---: | :---: |
123+
| [<img src="https://raw.githubusercontent.com/louislefevre/node-red-contrib-quantum/master/resources/quantum-nodes/circuit-initialisation-palette.png" alt="Input nodes palette" width="150px"/>](Input-Nodes) | [<img src="https://raw.githubusercontent.com/louislefevre/node-red-contrib-quantum/master/resources/quantum-nodes/qubit-control-palette.png" alt="Qubit node palette" width="150px"/>](Qubit-Nodes) | [<img src="https://raw.githubusercontent.com/louislefevre/node-red-contrib-quantum/master/resources/quantum-nodes/single-qubit-gate-palette.png" alt="Single qubit quantum gate node palette" width="150px"/>](Quantum-Gate-Nodes/#single-qubit-quantum-gates) | [<img src="https://raw.githubusercontent.com/louislefevre/node-red-contrib-quantum/master/resources/quantum-nodes/multi-qubits-gate-palette.png" alt="Multi qubits quantum gate node palette" width="150px"/>](Quantum-Gate-Nodes/#multi-qubits-quantum-gates) | [<img src="https://raw.githubusercontent.com/louislefevre/node-red-contrib-quantum/master/resources/quantum-nodes/circuit-output-palette.png" alt="Output node palette" width="150px"/>](Output-Nodes) |
124+
125+
126+
More information on *'quantum'* nodes can be found in the [Node-RED Quantum wiki](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Building-Quantum-Circuits).
98127

99128
## Quantum Algorithm Nodes
100-
To leverage the power of quantum computing in classical circuits, utilise the *'quantum algorithm'* nodes.
129+
Node-RED Quantum includes a *'quantum algorithm'* library of nodes that can be used to leverage the power of quantum computing in classical programs.
130+
131+
The nodes do not require any specific quantum knowledge to be used, except for some initial knowledge on the algorithm itself to have a better understanding of its use.
132+
133+
Those nodes encapsulate all the quantum-related operations so that users just have to input the right data in order to receive the quantum algorithm output.
134+
135+
The *'quantum algorithm'* library includes:
136+
137+
* [Grover's searching algorithm](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Algorithm-Nodes#grovers-algorithm)
138+
* [Shor's factoring algorithm](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Algorithm-Nodes#shors-algorithm)
101139

102-
More information on quantum algorithm nodes can be found in the [Node-RED Quantum wiki](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Algorithm-Nodes).
140+
More information on *'quantum algorithm'* nodes can be found in the [Node-RED Quantum wiki](https://github.com/node-red-quantum/node-red-contrib-quantum/wiki/Quantum-Algorithm-Nodes).
103141

104142
## Contributing
105143
For information on how to contribute, please read the [CONTRIBUTING](CONTRIBUTING.md) guidelines.
106144

107145
## Acknowledgements
108146
For details on the authors, please read the [AUTHORS](AUTHORS) file.
109147

110-
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. Special thanks to John McNamara for overseeing the development of this project, to David Clark for his supervision as Academic Supervisor, and to Sieglinde Pfaendler and James Wootton for their advice and guidance as our Quantum Mentors.
148+
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. Special thanks to John McNamara for overseeing the development of this project, to David Clark and Rae Harbird for their supervision as Academic Supervisors, and to Sieglinde Pfaendler and James Wootton for their advice and guidance as our Quantum Mentors.

nodes/quantum-algorithms/grovers/locales/en-US/grovers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script type="text/html" data-help-name="grovers">
22
<p>
3-
This node applies Grover's algorithm to find specified bit string value in the search space
3+
This node applies Grover's algorithm to find specified bit string value in the search space.
44
</p>
55

66
<h3>Inputs</h3>

nodes/quantum-algorithms/shors/locales/en-US/shors.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script type="text/html" data-help-name="shors">
22
<p>
3-
This node applies Shor's Factoring algorithm to find the prime factors for input integer N in polynomial time
3+
This node applies Shor's Factoring algorithm to find the prime factors for input integer N in polynomial time.
44
</p>
55

66
<h3>Inputs</h3>

nodes/quantum/ibm-quantum-system/locales/en-US/ibm-quantum-system.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
The quantum backends are provided by IBM Quantum Services.
55
</p>
66
<p>
7+
<b>This node requires an internet connection.</b>
8+
<br /><br />
79
<b>1 -</b>
8-
To do so, you need to open an <a href="https://www.ibm.com/account/">IBMid account</a> (free) and use it to
10+
First, you need to open an <a href="https://www.ibm.com/account/">IBMid account</a> (free) and use it to
911
sign in with <a href="https://quantum-computing.ibm.com/">IBM Quantum</a>. From the dashboard,
1012
you will be able to copy your API token and paste it into the node's properties.
1113
<br/><br/>
Binary file not shown.
Loading
Loading
Loading

0 commit comments

Comments
 (0)