diff --git a/test.ipynb b/example.ipynb similarity index 99% rename from test.ipynb rename to example.ipynb index 4e6810b..99c995d 100644 --- a/test.ipynb +++ b/example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 14, "id": "661cc049-99a3-4ee8-bb09-d32c285f2560", "metadata": {}, "outputs": [], @@ -10,7 +10,6 @@ "%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" ] }, @@ -26,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 16, "id": "516b75b0-4405-498e-9b10-125f2af3396e", "metadata": {}, "outputs": [ @@ -37,14 +36,14 @@ "
" ] }, - "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\")" ] }, { diff --git a/example.png b/example.png new file mode 100644 index 0000000..688500c Binary files /dev/null and b/example.png differ diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..0bc8c38 --- /dev/null +++ b/readme.md @@ -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). \ No newline at end of file