Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,10 @@ qasm3Parser.g4
.gitignore

config.json

# LaTeX Builds
*.aux
*.fdb_latexmk
*.fls
*.log
*.gz
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Finally, apply a measurement gate to every qubit to convert the quantum data int
After this process, we obtain the following quantum circuit.
<div align='center'>

![Figure 1](./figures/readme_figure_1.png)
![Figure 1](./figures/readme/figure_1.png)

</div>

Expand Down Expand Up @@ -79,7 +79,7 @@ meas = measure q;

<div align='center'>

![Figure 2](./figures/readme_figure_2.png)
![Figure 2](./figures/readme/figure_2.png)

</div>
The general workflow of QuantumC is shown in the diagram above: write a QuantumC program, compile it with the frontend to produce OpenQASM, then run that OpenQASM code to a local simulator or a cloud quantum backend.
Expand Down
22 changes: 22 additions & 0 deletions demos/random/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# Quantum Random Number Generator

## Algorithm Description

This quantum algorithm generates a uniformly distributed random number.

### Generating An Integer $n \in [a, b)$

$$
\begin{equation}
n = a + \left(\sum_{i=0}^{n-1} 2^ib_i \mod (b-a)\right)
\end{equation}
$$

### Generating A Floating-Point $f \in [a, b]$

$$
\begin{equation}
f = a + \frac{b-a}{2^n-1} \sum_{i=0}^{n-1} 2^ib_i
\end{equation}
$$

## Quantum Circuit Represenation
Binary file added figures/random/figure_1.pdf
Binary file not shown.
14 changes: 14 additions & 0 deletions figures/random/figure_1.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
\documentclass{article}

\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{quantikz2}

\begin{document}
\begin{quantikz}
\lstick{$\ket{0}$} \slice{$\ket{0}^{\otimes{n}}$} & \gate{H} \slice{$\ket{+}^{\otimes{n}}$} & \meter{} \\
\lstick{$\ket{0}$} & \gate{H} & \meter{} \\
\wave & & \\
\lstick{$\ket{0}$} & \gate{H} & \meter{}
\end{quantikz}
\end{document}
File renamed without changes
File renamed without changes
File renamed without changes.