Creating and manipulating Qbits

Contents

Creating and manipulating Qbits#

We should show how to:

  • Create Qbits

  • How Qbits can be added

  • Rotate

  • Center

  • Translate

import qse
import numpy as np
qbits = qse.Qbits(
    positions=np.array(
        [
            [1.0, 0.0, 0.0],
            [0.0, 0.0, 0.0],
            [0.0, 1.0, 0.0],
        ]
    ),
)
qbits.get_angle(0, 1, 2)
np.float64(90.0)
qbits.rotate(90, "z")
print(qbits)
Qbits(
 Qbit(label='0', position=[6.123233995736766e-17, 1.0, 0.0], state=[(1+0j), 0j], index=0),
 Qbit(label='1', position=[0.0, 0.0, 0.0], state=[(1+0j), 0j], index=1),
 Qbit(label='2', position=[-1.0, 6.123233995736766e-17, 0.0], state=[(1+0j), 0j], index=2),
 pbc=False,
...)

Version#

qse.utils.print_environment()
Python version: 3.12.3
qse version: 0.2.24