Skip to content

Commit

Permalink
Fix definition of site dims in plotting functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar committed Oct 25, 2021
1 parent 8910940 commit 555e39b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions qutip/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

try:
import matplotlib.pyplot as plt
except:
except ImportError:
pass


Expand Down Expand Up @@ -1052,8 +1052,7 @@ def display_unit_cell(self, label_on=False):
Qin[i, j] = self._H_intra[
i0*self._length_for_site+i,
j0*self._length_for_site+j]
dim_site = list(np.delete(self.cell_tensor_config, [0], None))
dims_site = [dim_site, dim_site]
dims_site = [self.cell_site_dof, self.cell_site_dof]
Hcell[i0][j0] = Qobj(Qin, dims=dims_site)

fig = plt.figure(figsize=[CNS*2, CNS*2.5])
Expand Down Expand Up @@ -1152,8 +1151,7 @@ def display_lattice(self):
Qin[i, j] = self._H_intra[
i0*self._length_for_site+i,
j0*self._length_for_site+j]
dim_site = list(np.delete(self.cell_tensor_config, [0], None))
dims_site = [dim_site, dim_site]
dims_site = [self.cell_site_dof, self.cell_site_dof]
Hcell[i0][j0] = Qobj(Qin, dims=dims_site)

j0 = 0
Expand Down Expand Up @@ -1242,6 +1240,5 @@ def display_lattice(self):
plt.axis('off')
plt.show()
plt.close()
dim_site = list(np.delete(self.cell_tensor_config, [0], None))
dims_site = [dim_site, dim_site]
dims_site = [self.cell_site_dof, self.cell_site_dof]
return Qobj(inter_T, dims=dims_site)

0 comments on commit 555e39b

Please sign in to comment.