1

I have the following code:

import numpy as np
import matplotlib.pyplot as plt

d0 = 0.3330630630630631
a0 = 0.15469469469469468

theta = 2
nmax=15

# lattice vectors sublattice 1
a1= np.array([3/2*a0,3**0.5/2*a0,0])
a2= np.array([3/2*a0,-3**0.5/2*a0,0])

# lattice vectors sublattice 2
b1 = np.array([ np.cos(theta) * a1[0] - np.sin(theta) * a1[1], np.sin(theta) * a1[0] + np.cos(theta) * a1[1], 0 ])
b2 = np.array([ np.cos(theta) * a2[0] - np.sin(theta) * a2[1], np.sin(theta) * a2[0] + np.cos(theta) * a2[1], 0 ])

## coordinates for the unrotated layer sublattice a&b
coords1a = np.array([i * a1 + j * a2 for i in range(-nmax-1, nmax+1) for j in range(-nmax-1, nmax+1)])
coords1b = np.array([i * a1 + j * a2 + [a0,0.,0.] for i in range(-nmax-1, nmax+1) for j in range(-nmax-1, nmax+1)])

## coordinates for the rotated layer sublattice a&b
coords2a = np.array([i * b1 + j * b2 + [0.,0.,d0]  for i in range(-nmax-1, nmax+1) for j in range(-nmax-1, nmax+1)])
coords2b = np.array([i * b1 + j * b2 + [np.cos(theta)*a0,np.sin(theta)*a0,d0] for i in range(-nmax-1, nmax+1) for j in range(-nmax-1, nmax+1)])

coords1 = np.concatenate((coords1a, coords1b))
coords2 = np.concatenate((coords2a, coords2b))

When I try to display my coords1 and coords2 lists, python give me a list than continue only 6 items with ", ... ," . I want to see all the values. How can I do that?

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
didem
  • 27
  • 3
  • Does this answer your question? [How do I print the full NumPy array, without truncation?](https://stackoverflow.com/questions/1987694/how-do-i-print-the-full-numpy-array-without-truncation) – Jorge Luis Mar 07 '23 at 08:37

2 Answers2

0

You can do:

import sys
import numpy
numpy.set_printoptions(threshold=sys.maxsize)

you can also use:

import numpy as np
np.set_printoptions(threshold=np.inf)

Link to doc :

https://numpy.org/doc/stable/reference/generated/numpy.set_printoptions.html

Talha Tayyab
  • 8,111
  • 25
  • 27
  • 44
0

to quickly see all the elements try

print(*coords1)

and

print(*coords2)

Arun Kumar Khattri
  • 1,519
  • 15
  • 25