Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Dpbm committed Apr 17, 2024
1 parent ea06084 commit 45cb090
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test.ipynb → example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 14,
"id": "661cc049-99a3-4ee8-bb09-d32c285f2560",
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"from qiskit_aer import AerSimulator\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from transcode import create_circuit, measure_cg, decode_cg, decode_au, measure_au"
]
},
Expand All @@ -26,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 16,
"id": "516b75b0-4405-498e-9b10-125f2af3396e",
"metadata": {},
"outputs": [
Expand All @@ -37,14 +36,14 @@
"<Figure size 414.367x451.5 with 1 Axes>"
]
},
"execution_count": 9,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"qc, qreg, meas = create_circuit('AUCG')\n",
"qc.draw('mpl')"
"qc.draw('mpl', filename=\"example.png\")"
]
},
{
Expand Down
Binary file added example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# RNA to DNA using quantum circuits

This is a simple circuit to transcribe a RNA to a DNA using quantum computing

## How it works?

the bases are encoding in two different basis in the Bloch sphere

$C$ and $G$ are encoded in the computational basis using the $X$ gate, while the $A$ and $U$ encoded in the Hadamard basis using the $H$ gate.

With this protocol, we insert the input RNA as gates in the cirucit, and the we rotate by $\pi$ using the $RY$ to get the relative base for the DNA.

![example](./example.png)

After that, we have encoded values in two different basis. To get the relative DNA bases, are used measurements on both $Z$ and $X$, and the values pos-processed by a classical algorithm.

## How to use?

To check the project out, you may need to install some dependencies by running:

```bash
pip install -r requirements.txt

# or with conda

conda deactivate
conda env create -f environment.yml
conda activate dna-quantum
```

Then, you can check the [example.ipynb](./example.ipynb) or the functions source code at [transcode.py](./transcode.py).

0 comments on commit 45cb090

Please sign in to comment.