Skip to content

Target Quantum Systems

The class for target Hamiltonian.

It is a container of the desired piecewise constant evolution.

QSystem

Bases: BaseQuantumEnvironment

A target quantum system.

It contains a list of evolutions (h, t), which represents evolving under h for time duration t.

We also provide a syntax sugar to discretize a continuous-time Hamiltonian.

Source code in SimuQ/simuq/qsystem.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class QSystem(BaseQuantumEnvironment) :
    """ A target quantum system.

    It contains a list of evolutions (h, t), which 
    represents evolving under h for time duration t.

    We also provide a syntax sugar to discretize
    a continuous-time Hamiltonian.
    """
    def __init__(self) :
        super().__init__()
        self.evos = []

    def add_evolution(self, h, t) :
        self.evos.append((h, t))

    def add_time_dependent_evolution(self, ht, ts) :
        for i in range(len(ts) - 1) :
            self.add_evolution(ht(ts[i]), ts[i + 1] - ts[i])

    def clear_evos(self) :
        self.evos = []