Quantum mechanics with BraketLab#

Author Audun Skau Hansen ✉️

The Hylleraas Centre for Quantum Molecular Sciences, 2022


Overview#

This is a brief tutorial on some main functionality of BraketLab. The goal is to make you comfortable with using the software to solve exercises in the coming sessions. Check out the full documentation for a more in-depth introduction.

A baby leap#

Let’s just jump into the fun:

import braketlab as bk
import numpy as np

# make some kets
p1 = bk.basisbank.get_gto(1.0, 4,-2, position = np.array([-.2,0,0]))
p2 = bk.basisbank.get_gto(1.0, 4,-1, position = np.array([-.1,0,0]))
p3 = bk.basisbank.get_gto(1.0, 4, 0, position = np.array([ .0,0,0]))
p4 = bk.basisbank.get_gto(1.0, 4, 1, position = np.array([ .1,0,0]))
p5 = bk.basisbank.get_gto(1.0, 4, 2, position = np.array([ .2,0,0]))

# set some energies
p1.energy = [.5]
p2.energy = [.6]
p3.energy = [.7]
p4.energy = [.8]
p5.energy = [.9]

# display the sum of the kets
(p1+p2+p3+p4+p5).view()