test_real=[]
for count1, value1 in enumerate (system):
for count2, value2 in enumerate(system[1:], start=1):
if count1!=count2 and count1<count2: #ensures that we don't loop molecule itself and no repeats as 1-2 and 2-1 are the same
complete=[]
# this nlist finds the shortest distance between atoms of each molecule
nlist = freud.AABBQuery(box, value1).query(value2, {'mode': 'nearest','num_neighbors':1}).toNeighborList()
print("molecule", count1, count2)
#filter through this neighbour nlist to obtain the shortest distance between molecules
for (i,j), distance in zip(nlist, nlist.distances):
temp=([count1,count2, distance])
complete.append(temp)
complete2=np.array(complete)
column=2 #selecting the distance column
# save only the shortest distance between molecules
shortest=complete2[complete2[:, column].argmin()]
print(shortest)
test_real=np.append(test_real, shortest, axis=0)