Skip to content

Commit

Permalink
merge conflict resolved in phase-gate.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Winter-Soren committed Mar 26, 2024
2 parents 7385ddf + 03983e2 commit 925a9ef
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 117 deletions.
32 changes: 16 additions & 16 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
15 changes: 7 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ You can contribute to our project in various ways, including but not limited to:
9. You can add new plugins to the documentation, but make sure to follow the [mkdocs plugins](https://squidfunk.github.io/mkdocs-material/plugins/) for reference.
10. You can also change the setup of the documentation, but make sure to follow the [mkdocs setup](https://squidfunk.github.io/mkdocs-material/setup/) for reference.


## Getting Started

If you're new to contributing to open-source projects or our project specifically, here are some steps to get started:
Expand All @@ -36,13 +35,13 @@ If you're new to contributing to open-source projects or our project specificall

To maintain consistency and readability across the codebase, we follow certain coding standards and style guidelines. Here are some general principles:

- Use 3-4 level depth of headings in the markdown files.
- Make sure to add captions to images, and tables.
- If image is outsourced, then make sure to add the source of the image either in the image caption or in the reference tab.
- To write equation in the sentence use 'MathJax' and to write equation in a separate line use 'KaTeX'.
- Any new equation written using 'KaTex' should have a equation number.
- If writing code for demonstration, then make sure to use ONE single library (either use qiskit or pennylane or cirq) to demonstrate the topic.
- Use the `mkdocs` markdown syntax for writing the documentation.
- Use 3-4 level depth of headings in the markdown files.
- Make sure to add captions to images, and tables.
- If image is outsourced, then make sure to add the source of the image either in the image caption or in the reference tab.
- To write equation in the sentence use 'MathJax' and to write equation in a separate line use 'KaTeX'.
- Any new equation written using 'KaTex' should have a equation number.
- If writing code for demonstration, then make sure to use ONE single library (either use qiskit or pennylane or cirq) to demonstrate the topic.
- Use the `mkdocs` markdown syntax for writing the documentation.

## Code Review Process

Expand Down
103 changes: 55 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This repository contains comprehensive documentation on Quantum Machine Learning (QML), aimed at beginners and practitioners interested in exploring the intersection of quantum computing and machine learning.

## Table of Contents

1. [How to get started with the documentation](#how-to-get-started-with-the-documentation)
2. [Contribution Guidelines](./CONTRIBUTING.md)
3. [Status of the Project](#status-of-the-project)
Expand All @@ -11,85 +12,92 @@ This repository contains comprehensive documentation on Quantum Machine Learning
6. [License](#license)

## How to get started with the documentation

When you go to the [live website](https://quantummlhandbook.vercel.app/) or local server [after installation](#installation), you will see the following tabs in the navigation bar:

* **Home**: This is the landing page of the documentation. It contains a brief overview of the documentation and the project.
- **Home**: This is the landing page of the documentation. It contains a brief overview of the documentation and the project.

`Under the Documentation drop down in navigation bar:`
* **Basics**: This section contains the basics of quantum computing and quantum mechanics. It is aimed at beginners who are new to quantum computing and quantum mechanics. The contents are marked using 1, 2, 3, etc. to indicate the order of learning the topics

* **Gates and Circuits**: This section contains the basics of quantum gates and circuits. It is aimed at beginners who are new to quantum gates and circuits.
- **Basics**: This section contains the basics of quantum computing and quantum mechanics. It is aimed at beginners who are new to quantum computing and quantum mechanics. The contents are marked using 1, 2, 3, etc. to indicate the order of learning the topics

- **Gates and Circuits**: This section contains the basics of quantum gates and circuits. It is aimed at beginners who are new to quantum gates and circuits.

## Status of the Project
- [x] The framework of the documentation is ready.
- [x] Overview.
- [x] General issues in QC.
- [x] Notations and representations.
- [X] Fundamentals of Quantum Mechanics.
- [x] Qubits.
- [x] Superposition.
- [x] Entanglement.
- [x] Bloch Sphere.
- [ ] Understanding Quantum gates (analogy with classical gates).
- [ ] Single qubit gates.
- [x] Pauli gates.
- [x] Hadamard gate.
- [x] Phase gate.
- [ ] T gate.
- [ ] S gate.
- [ ] U gate.
- [ ] Multi qubit gates.
- [ ] CNOT gate.
- [ ] SWAP gate.
- [ ] Toffoli gate.
- [ ] Fredkin gate.
- [ ] Controlled U gate.
- [ ] Controlled phase gate.
- [ ] Universal gates.
- [ ] X, Y, Z gates.
- [ ] Hadamard gate.
- [ ] CNOT gate.
- [ ] Toffoli gate.
- [ ] SWAP gate.
- [ ] Fredkin gate.
- [ ] Quantum circuits.
- [ ] How to construct any circuit.
- [ ] Quantum ML algorithms (algos like SVM, KNN etc).
- [ ] Quantum Neural Networks.
- [ ] Quantum Convolutional Neural Networks.
- [ ] Quantum Generative Adversarial Networks.
- [ ] Quantum Reinforcement Learning.
- [ ] Quantum Transfer Learning.
- [ ] Quantum Autoencoders.

- [x] The framework of the documentation is ready.
- [x] Overview.
- [x] General issues in QC.
- [x] Notations and representations.
- [x] Fundamentals of Quantum Mechanics.
- [x] Qubits.
- [x] Superposition.
- [x] Entanglement.
- [x] Bloch Sphere.
- [ ] Understanding Quantum gates (analogy with classical gates).
- [ ] Single qubit gates.
- [x] Pauli gates.
- [x] Hadamard gate.
- [x] Phase gate.
- [ ] T gate.
- [ ] S gate.
- [ ] U gate.
- [ ] Multi qubit gates.
- [ ] CNOT gate.
- [ ] SWAP gate.
- [ ] Toffoli gate.
- [ ] Fredkin gate.
- [ ] Controlled U gate.
- [ ] Controlled phase gate.
- [ ] Universal gates.
- [ ] X, Y, Z gates.
- [ ] Hadamard gate.
- [ ] CNOT gate.
- [ ] Toffoli gate.
- [ ] SWAP gate.
- [ ] Fredkin gate.
- [ ] Quantum circuits.
- [ ] How to construct any circuit.
- [ ] Quantum ML algorithms (algos like SVM, KNN etc).
- [ ] Quantum Neural Networks.
- [ ] Quantum Convolutional Neural Networks.
- [ ] Quantum Generative Adversarial Networks.
- [ ] Quantum Reinforcement Learning.
- [ ] Quantum Transfer Learning.
- [ ] Quantum Autoencoders.

## Installation

before you start, make sure you have the following installed:
- Node v18.x or higher

- Node v18.x or higher

install node_modules:

```bash
npm install
```

to run the documentation locally, run the following command:

```bash
npm start
```

now you can access the documentation at `http://localhost:3000/` in your browser.

## Project Structure

The project structure is as follows:

```
├───.github
│ ├───ISSUE_TEMPLATE
│ └───workflows
├───docs
│ ├───basics
│ ├───gates-and-circuits
├───src
│ ├───components
│ ├───pages
Expand All @@ -101,9 +109,8 @@ The project structure is as follows:
└───mkdocs.yml
```

this is standard file and folder structure of docusaurus v2. the static folder contains the images and after building the static folder will remain the same. the docs folder contains the markdown files for the documentation. the src folder contains the source code for the documentation.

this is standard file and folder structure of docusaurus v2. the static folder contains the images and after building the static folder will remain the same. the docs folder contains the markdown files for the documentation. the src folder contains the source code for the documentation.

## License
MIT License

MIT License
52 changes: 24 additions & 28 deletions docs/quantum-gates-circuits/hadamard-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,44 @@ sidebar_label: 3. Hadamard Gate
---

# Hadamard Gate
## Definition

## Definition

The Hadamard gate is a single qubit gate that is used to create superposition. The Hadamard gate is named after the mathematician Jacques Hadamard. The Hadamard gate is used to change the state of the qubit in terms of the $X$ and $Z$ axes of the Bloch sphere. The Hadamard gate is used to perform the bit-flip and phase-flip operations. The Hadamard gate is the most commonly used gate in quantum computing after the Pauli gates.

## Effect on qubit

The Hadamard gate changes the state of the qubit from $|0\rangle$ to $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ and vice versa. The Hadamard gate changes the phase of the qubit from $+1$ to $-1$ and vice versa.
The Hadamard gate changes the state of the qubit from $|0\rangle$ to $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ and vice versa. The Hadamard gate changes the phase of the qubit from $+1$ to $-1$ and vice versa.

PS: you must be thinking that the operations performed by the Hadamard gate are similar to the Pauli gates. Well, you are right! The Hadamard gate is a combination of the Pauli-X and Pauli-Z gates. The Hadamard gate is the most versatile gate in quantum computing, as it can be used to create superposition, entanglement, and perform phase-flip and bit-flip operations.

PS: you must be thinking that the operations performed by the Hadamard gate are similar to the Pauli gates. Well, you are right! The Hadamard gate is a combination of the Pauli-X and Pauli-Z gates. The Hadamard gate is the most versatile gate in quantum computing, as it can be used to create superposition, entanglement, and perform phase-flip and bit-flip operations.
## Property

## Property
Psst... only hadamard has it!!

When a qubit is in the state |0⟩, it means that it is definitely in the state |0⟩ with probability amplitude 1 and in the state |1⟩ with probability amplitude 0.
When a qubit is in the state |0⟩, it means that it is definitely in the state |0⟩ with probability amplitude 1 and in the state |1⟩ with probability amplitude 0.

This means that Hadamard gate transforms this |0⟩ state into an equal superposition of |0⟩ and |1⟩. This means that after applying the Hadamard gate to the |0⟩ state, the qubit is in a state where it has a 50% chance of being measured as |0⟩ and a 50% chance of being measured as |1⟩. Mathematically, this transformation can be represented as:

$ H|0\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) $

Similarly, when a qubit is in the state |1⟩, it is definitely in the state |1⟩ with probability amplitude 1 and in the state |0⟩ with probability amplitude 0.
Similarly, when a qubit is in the state |1⟩, it is definitely in the state |1⟩ with probability amplitude 1 and in the state |0⟩ with probability amplitude 0.

The Hadamard gate also transforms this |1⟩ state into an equal superposition of |0⟩ and |1⟩. So, after applying the Hadamard gate to the |1⟩ state, the qubit is in a state where it has a 50% chance of being measured as |0⟩ and a 50% chance of being measured as |1⟩. This transformation can be represented as:

$ H|1\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle) $



## Types

The Hadamard gate has only one type.

## Matrix representation
## Matrix representation

The matrix representation of the Hadamard gate is:
* `Hadamard gate`: $\frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$
The matrix representation of the Hadamard gate is: \* `Hadamard gate`: $\frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$

## Circuit representation
## Circuit representation

The Hadamard gate is represented as ` ───H─── ` in the circuit.
The Hadamard gate is represented as `───H───` in the circuit.

## Example

Expand All @@ -51,7 +51,7 @@ Certainly! Let's explore an example demonstrating the working of the Hadamard ga

Suppose we have a qubit initially in the state $ |0\rangle $, represented as:

$$
$$
|q_0\rangle = |0\rangle
\tag{7}
$$
Expand All @@ -63,7 +63,7 @@ H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}
\tag{8}
$$

To apply the Hadamard gate to the qubit $ |q_0\rangle = |0\rangle $, we perform a matrix multiplication of the Hadamard gate matrix with the state vector representing $ |0\rangle $.
To apply the Hadamard gate to the qubit $ |q_0\rangle = |0\rangle $, we perform a matrix multiplication of the Hadamard gate matrix with the state vector representing $ |0\rangle $.

$$
H|q_0\rangle = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix}
Expand Down Expand Up @@ -102,28 +102,24 @@ The circuit representation of this operation is as follows:

Initial state: |0⟩

───H───
───H───

Final state: $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle$

## Properties
## Properties

The properties of the Hadamard gate are:
* The Hadamard gate is Hermitian, i.e., the conjugate transpose of the gate is equal to the gate itself (i.e., $H^\dagger = H$).
* The Hadamard gate is involutory, i.e., applying the gate twice results in the identity gate.
* The Hadamard gate is a unitary gate, i.e., the inverse of the gate is equal to the conjugate transpose of the gate (i.e., $H^{-1} = H^\dagger$).
_ The Hadamard gate is Hermitian, i.e., the conjugate transpose of the gate is equal to the gate itself (i.e., $H^\dagger = H$).
_ The Hadamard gate is involutory, i.e., applying the gate twice results in the identity gate. \* The Hadamard gate is a unitary gate, i.e., the inverse of the gate is equal to the conjugate transpose of the gate (i.e., $H^{-1} = H^\dagger$).

## Conjugate transpose
## Conjugate transpose

The conjugate transpose of the Hadamard gate is:
* `Hadamard gate`: $\frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$
The conjugate transpose of the Hadamard gate is: \* `Hadamard gate`: $\frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$

## Inverse
## Inverse

The inverse of the Hadamard gate is:
* `Hadamard gate`: $\frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$
The inverse of the Hadamard gate is: \* `Hadamard gate`: $\frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$

## Dagger

The dagger of the Hadamard gate is:
* `Hadamard gate`: $H^\dagger = H$
The dagger of the Hadamard gate is: \* `Hadamard gate`: $H^\dagger = H$
7 changes: 4 additions & 3 deletions docs/quantum-gates-circuits/pauli-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ sidebar_label: 2. Pauli Gate
## Definition

The Pauli gates are a set of three single qubit gates that are used to change the state of a qubit. The Pauli gates are:
- `Pauli-X gate`
- `Pauli-Y gate`
- `Pauli-Z gate`

- `Pauli-X gate`
- `Pauli-Y gate`
- `Pauli-Z gate`

## Effect on qubit

Expand Down
7 changes: 2 additions & 5 deletions docs/quantum-gates-circuits/phase-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ sidebar_label: 4. Phase Gate
The phase gate is a single-qubit gate used to change the phase of the qubit. Also known as the $R_\phi$ gate, it alters the phase of the qubit along the $Z$ axis of the Bloch sphere, performing a phase-flip operation. It is one of the most commonly used gates in quantum computing after the Pauli gates and the Hadamard gate.

## Effect on qubit

The phase gate changes the phase of the qubit from $+1$ to $-1$ and vice versa.

PS: You might be thinking that this operation is performed by the Pauli-Z gate as well. Indeed, both gates perform the same operation, but the Phase gate is a generalization of the Pauli-Z gate. The distinction lies in the phase change introduced: Pauli-Z gate introduces a phase change of $\pi$ ($180$ degrees) to the $|1\rangle$ state, while the Phase gate introduces a phase change of $\pi/2$ ($90$ degrees) to the $|1\rangle$ state.
Expand Down Expand Up @@ -89,15 +90,11 @@ The circuit representation of this operation is as follows:

Initial state: $|0\rangle$

───Rz───
───Rz───

Final state: $|0\rangle$

## Properties
The properties of the phase gate are:
* The phase gate is Hermitian, i.e., the conjugate transpose of the gate is equal to the gate itself (i.e., $Rz^\dagger = Rz$).
* The phase gate is involutory, i.e., applying the gate twice results in the identity gate.
* The phase gate is a unitary gate, i.e., the inverse of the gate is equal to the conjugate transpose of the gate (i.e., $Rz^{-1} = Rz^\dagger$).

## Conjugate Transpose
The conjugate transpose of the phase gate is:
Expand Down
Loading

1 comment on commit 925a9ef

@vercel
Copy link

@vercel vercel bot commented on 925a9ef Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.