Skip to content

Commit

Permalink
[fix] image size
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-Zen committed Sep 7, 2024
1 parent f865eca commit 8386cc6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 27 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The function `quantum-circuit()` takes any number of positional gates and works

```typ
#{
import "@preview/quill:0.3.0": *
import "@preview/quill:0.4.0": *
quantum-circuit(
lstick($|0〉$), $H$, ctrl(1), rstick($(|00〉+|11〉)/√2$, n: 2), [\ ],
Expand Down Expand Up @@ -62,7 +62,7 @@ Instead of listing every featured gate (as is done in the [user guide][guide]),
_Tequila_ is a submodule that adds a completely different way of building circuits.

```typ
#import "@preview/quill:0.3.0" as quill: tequila as tq
#import "@preview/quill:0.4.0" as quill: tequila as tq
#quill.quantum-circuit(
..tq.build(
Expand All @@ -78,10 +78,12 @@ Now, we still have the option to add annotations, groups, slices, or even more g

The syntax works analog to Qiskit. Available gates are `x`, `y`, `z`, `h`, `s`, `sdg`, `sx`, `sxdg`, `t`, `tdg`, `p`, `rx`, `ry`, `rz`, `u`, `cx`, `cz`, and `swap`. With `barrier`, an invisible barrier can be inserted to prevent gates on different qubits to be packed tightly. Finally, with `tq.gate` and `tq.mqgate`, a generic gate can be created. These two accept the same styling arguments as the normal `gate` (or `mqgate`).

Also like Qiskit, all qubit arguments support ranges, e.g., `tq.h(range(5))` adds a Hadamard gate on the first five qubits and `tq.cx((0, 1), (1, 2))` adds two #smallcaps[cx] gates: one from qubit 0 to 1 and one from qubit 1 to 2.
Also like Qiskit, all qubit arguments support ranges, e.g., `tq.h(range(5))` adds a Hadamard gate on the first five qubits and `tq.cx((0, 1), (1, 2))` adds two CX gates: one from qubit 0 to 1 and one from qubit 1 to 2.

With Tequila, it is easy to build templates for quantum circuits and to compose circuits of various building blocks. For this purpose, `tq.build()` and the built-in templates all feature optional `x` and `y` arguments to allow placing a subcircuit at an arbitrary position of the circuit.
As an example, Tequila provides a `tq.graph-state()` template for quickly drawing graph state preparation circuits. The following example demonstrates how to compose multiple subcircuits.
As an example, Tequila provides a `tq.graph-state()` template for quickly drawing graph state preparation circuits.

The following example demonstrates how to compose multiple subcircuits.


```typ
Expand Down Expand Up @@ -119,6 +121,7 @@ Some show-off examples, loosely replicating figures from [Quantum Computation an
<img alt="Quantum fourier transformation circuit" src="docs/images/qft.svg">
</h3>


## Contribution

If you spot an issue or have a suggestion, you are invited to [post it](https://github.com/Mc-Zen/quill/issues) or to contribute. In [architecture.md](docs/architecture.md), you can also find a description of the algorithm that forms the base of `quantum-circuit()`.
Expand Down Expand Up @@ -177,12 +180,11 @@ This package uses [typst-test](https://github.com/tingerrr/typst-test/) for runn
- Add section on creating custom gates.
- Add section on using labels.
- Explain usage of `slice()` and `gategroup()`.
<!-- - Add Tips and tricks section -->

### v0.1.0

Initial Release


[guide]: https://github.com/Mc-Zen/quill/releases/download/v0.3.0/quill-guide.pdf
[guide]: https://github.com/Mc-Zen/quill/releases/download/v0.4.0/quill-guide.pdf
[tidy]: https://github.com/Mc-Zen/tidy
4 changes: 3 additions & 1 deletion docs/guide/quill-guide.typ
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,9 @@ The syntax works analog to Qiskit. Available gates are `x`, `y`, `z`, `h`, `s`,
Also like Qiskit, all qubit arguments support ranges, e.g., `tq.h(range(5))` adds a Hadamard gate on the first five qubits and `tq.cx((0, 1), (1, 2))` adds two #smallcaps[cx] gates: one from qubit 0 to 1 and one from qubit 1 to 2.
With Tequila, it is easy to build templates for quantum circuits and to compose circuits of various building blocks. For this purpose, `tq.build()` and the built-in templates all feature optional `x` and `y` arguments to allow placing a subcircuit at an arbitrary position of the circuit.
As an example, Tequila provides a `tq.graph-state()` template for quickly drawing graph state preparation circuits. The following example demonstrates how to compose multiple subcircuits.
As an example, Tequila provides a `tq.graph-state()` template for quickly drawing graph state preparation circuits.
The following example demonstrates how to compose multiple subcircuits.
#example(scale: 74%,
```typ
Expand Down
36 changes: 18 additions & 18 deletions docs/images/composition.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/images/create-image.typ
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#set page(width: auto, height: auto, margin: 0pt)

#let scale-factor = 130%
#let content = include("/examples/qft.typ")
#let scale-factor = 100%
#let content = include("/examples/composition.typ")

#style(styles => {
let size = measure(content, styles)
Expand Down

0 comments on commit 8386cc6

Please sign in to comment.