True-Q Fundamentals

This section provides an overview of True-Q™’s basic building blocks and an introduction to True-Q™’s circuit description language.

We use the following high-level classes to define circuits, their components, and their results:

Using these, the circuit above can be implemented as follows:

```import trueq as tq

cycle1 = {0: tq.Gate.h, 1: tq.Gate.h, 2: tq.Gate.h}
cycle2 = {(0, 1): tq.Gate.cz}
cycle3 = {(0, 2): tq.Gate.cz}
cycle4 = {1: tq.Gate.h, 2: tq.Gate.h}

circuit = tq.Circuit([cycle1, cycle2, cycle3, cycle4])
circuit.measure_all()

circuit.draw()
```

And we can populate the `Results` by using our built-in `Simulator`:

```sim = tq.Simulator()
sim.run(circuit, n_shots=100)

circuit.results.plot()
```

The following pages cover all these basic building blocks in more detail. The `Simulator` is covered in Running Circuits.

1. Example: Quantum Circuits in True-Q™

A hands-on example that explains the basic circuit elements

2. Circuit Components

Reviews the fundamental True-Q™ classes for circuit construction

3. Example: Quantum Circuits with Qudits

An example showing how True-Q™ circuits can be constructed for qudits

Provides a formal introduction into the qudit formalism and mathematical background

5. Keys: Storing and Filtering Metadata

Gives an overview of the object `Key` that is used to store and filter metadata associated with circuits and estimates.

6. Circuit Collections

Gives an overview of the tools True-Q™ contains for storing, filtering, and manipulating collections of quantum circuits.

7. Parsing Estimate Collections

Gives an overview of how to effectively parse and extract information from the fitting routines of True-Q™.

8. Example: Recording Results

Shows how to work with the `Results`class.