Loading a Config

Config objects can be loaded from disk and saved to disk.

import trueq as tq
import numpy as np

# load the config file from disk
config = tq.Config("config.yaml")

We can construct ony of the gates defined in this config file.

config.MS(phi=np.pi / 2)
True-Q formatting will not be loaded without trusting this notebook or rerunning the affected cells. Notebooks can be marked as trusted by clicking "File -> Trust Notebook".
Name:
  • Test.MS
Likeness:
  • Non-Clifford
Parameters:
  • phi = 1.570796
Generators:
  • 'XX': 1.571
Matrix:
  • -1.00j -0.01 -1.00j -0.01 -0.01 -1.00j -0.01 -1.00j


They can also be constructed inside the python session. The easiest way to construct standard configurations is with basic(). In the following example, our config will contain \(X\) and \(Z\) pauli rotations, along with a single static two qubit gate:

config = tq.Config.basic("Example", entangler=tq.Gate.cz)

config.cz()
True-Q formatting will not be loaded without trusting this notebook or rerunning the affected cells. Notebooks can be marked as trusted by clicking "File -> Trust Notebook".
Name:
  • GateFactory.cz
Aliases:
  • Gate.cz
Likeness:
  • CNOT
Generators:
  • 'IZ': 90.0
  • 'ZI': 90.0
  • 'ZZ': -90.0
Matrix:
  • 1.00 1.00 1.00 -1.00


Total running time of the script: ( 0 minutes 0.090 seconds)

Gallery generated by Sphinx-Gallery