Added some readmes

This commit is contained in:
Daniel Tsvetkov 2019-09-25 08:44:26 +02:00
parent 2477bc6517
commit 71a21fb439
8 changed files with 110 additions and 2 deletions

18
00_qkd.md Normal file
View File

@ -0,0 +1,18 @@
# Implement Quantum Key Distribution (QKD) in Python
1. You have Alice and Bob who want to communicate, they have a quantum and a
classical channel.
2. There is of course Mallory who can be the standard Man-in-the-middle,
listening on both channels (with QKD we should be able to at least detect her)
3. Alice and Bob should be able to agree on a One-Time-Pad (OTP) - a series
of bytes that are random. Using this, they can use whatever protocol to
actually encrypt messages (imagine even ceaser shift where each letter is
shifted by that many units using the OTP bits, or even simpler - XORing)
4. Alice and Bob are able to agree on an OTP using qbits in two orthogonal
quantum bases where Bob chooses at random which base to measure and what output
he got.
## Sources:
* [The Code Book](https://www.amazon.com/Code-Book-Science-Secrecy-Cryptography/dp/0385495323)
* [wiki](https://en.wikipedia.org/wiki/Quantum_key_distribution)

8
01_computer.md Normal file
View File

@ -0,0 +1,8 @@
# Quantum Computer in Python from first principles
1. Reinvent how to multiply matrices
2. Present qbits and gates as matrices
3. Override multiplication for qbits to be tensor multiplication and for gates
to be matrix (TODO: why??)
4. Test basic operations such as Identity matrix, Pauli gates, creating
superposition with Hadamard, creating entanglement with CNOT.

5
02_INSTALL_CIRQ.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
sudo apt-get install python3-tk texlive-latex-base latexmk
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt

7
02_cirq.md Normal file
View File

@ -0,0 +1,7 @@
# Learning Google's CIRQ
You need to run `./02_INSTALL_CIRQ.sh` to install this (at least on Ubuntu-based
distros, having naturally python > 3.5, check with `python3 --version`)
## Sources:
* [Official Tutorial](https://cirq.readthedocs.io/en/stable/tutorial.html)

View File

@ -15,4 +15,24 @@ print(circuit)
simulator = cirq.Simulator()
result = simulator.run(circuit, repetitions=20)
print("Results:")
print(result)
print(result)
# ----- Tutorial
import cirq
import numpy as np
import matplotlib
# Print Google's 72-qbit Bristlecone
print(cirq.google.Bristlecone)
# Use named Qubits
a = cirq.NamedQubit("a")
b = cirq.NamedQubit("b")
c = cirq.NamedQubit("c")
ops = [cirq.H(a), cirq.H(b), cirq.CNOT(b, c), cirq.H(b)]
circuit = cirq.Circuit.from_ops(ops)
print(circuit)
for i, moment in enumerate(circuit):
print('Moment {}: {}'.format(i, moment))

View File

@ -1,3 +1,5 @@
# High level overview of RSA and Shor's algo
RSA relies on:
```
@ -26,4 +28,5 @@ A, B -> A^p = m*B + 1
```
## Sources:
* [Minute Physics - Quantum Crypto video](https://www.youtube.com/watch?v=lvTqbM5Dq4Q)

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# Quantum
This is an experimental repo where I learn quantum computers.
See corresponding md-s for explanation of each.

43
requirements.txt Normal file
View File

@ -0,0 +1,43 @@
backcall==0.1.0
cachetools==3.1.1
certifi==2019.9.11
chardet==3.0.4
cirq==0.5.0
cycler==0.10.0
decorator==4.4.0
google-api-python-client==1.7.11
google-auth==1.6.3
google-auth-httplib2==0.0.3
httplib2==0.13.1
idna==2.8
ipython==7.8.0
ipython-genutils==0.2.0
jedi==0.15.1
kiwisolver==1.1.0
matplotlib==2.2.4
mpmath==1.1.0
networkx==2.3
numpy==1.17.2
parso==0.5.1
pexpect==4.7.0
pickleshare==0.7.5
prompt-toolkit==2.0.9
protobuf==3.9.2
ptyprocess==0.6.0
pyasn1==0.4.7
pyasn1-modules==0.2.6
Pygments==2.4.2
pyparsing==2.4.2
python-dateutil==2.8.0
pytz==2019.2
requests==2.22.0
rsa==4.0
scipy==1.3.1
six==1.12.0
sortedcontainers==2.1.0
sympy==1.4
traitlets==4.3.2
typing-extensions==3.7.4
uritemplate==3.0.0
urllib3==1.25.6
wcwidth==0.1.7