Matrix elements#

For a number of purposes, one needs to compute matrix elements of operators such as the charge operator with respect to the eigenstates of the system. For a display of the matrix elements of the operator n_operator (the charge number operator), use:

[9]:
transmon.plot_matrixelements('n_operator', evals_count=10);
../../_images/guide_basics_basics-matrixelements_4_0.svg

An alternative way to display matrix elements is to use a pure 2d representation with text representation of each matrix element entry. Here, we use the example of the .cos_phi_operator:

[10]:
transmon.plot_matrixelements('cos_phi_operator', evals_count=10, show3d=False, show_numbers=True);
../../_images/guide_basics_basics-matrixelements_6_0.svg

To store the matrix elements in a numpy array, utilize the method matrixelement_table():

[11]:
nmat = transmon.matrixelement_table('sin_phi_operator', evals_count=3)
nmat
[11]:
array([[0.-1.21430643e-17j, 0.-4.71298793e-01j, 0.-1.26356452e-03j],
       [0.+4.71298793e-01j, 0.+4.16333634e-17j, 0.-5.72832824e-01j],
       [0.+1.26356452e-03j, 0.+5.72832824e-01j, 0.-2.52259042e-20j]])

Sometimes it is useful to plot matrix elements as a function of an external parameter. This is accomplished by the method plot_matelem_vs_paramvals(), here for the dependence of charge-operator matrix elements on the offset charge ng:

[12]:
ng_list = np.linspace(-2, 2, 220)
transmon.plot_matelem_vs_paramvals('n_operator', 'ng', ng_list, select_elems=4);
../../_images/guide_basics_basics-matrixelements_10_1.svg