from numpy import zeros
from numpy.linalg import inv


class Structure(object):
    """
        Contains positions, species, cell, cutoff rad, previous positions,
        forces, and stds of forces, computes inv_cell and bond list

        :param lattice: nparray, 3x3 Bravais Lattice
        :param species: list[str], List of elements
        :param positions: list[nparray] list of positions
        :param cutoff: float, Cutoff radius for GP

    """

    def __init__(self, lattice, species, positions, cutoff):
        self.lattice = lattice
        self.vec1 = lattice[0, :]
        self.vec2 = lattice[1, :]
        self.vec3 = lattice[2, :]

        self.species = species
        self.elements = set(species)
        self.bond_list = self.calc_bond_list(self.elements)

        self.inv_lattice = inv(lattice)

        self.positions = positions
        self.prev_positions = list(positions)
        self.forces = [zeros(3) for pos in positions]
        self.stds = [zeros(3) for pos in positions]

        self.cutoff = cutoff

    def calc_bond_list(self, elements):
        bond_list = []
        pass
        return bond_list

@@ -46,16 +46,35 @@
 ort inv%0A
+import numpy as np%0A
 %0A%0Aclass 
@@ -718,16 +718,21 @@
 ments = 
+list(
 set(spec
@@ -735,16 +735,17 @@
 species)
+)
 %0A       
@@ -1057,16 +1057,34 @@
 cutoff%0A%0A
+    @staticmethod%0A
     def 
@@ -1102,24 +1102,578 @@
 ist(
-self, elements):
+unique_species):%0A        %22%22%22Converts unique species to a list of bonds.%0A%0A        :param unique_species: unique species in the simulation%0A        :type unique_species: list of strings%0A        :return: all possible bonds%0A        :rtype: list of lists of two strings%0A        %22%22%22%0A%0A        # create bond list%0A        bond_list = %5B%5D%0A        for m in range(len(unique_species)):%0A            species_1 = unique_species%5Bm%5D%0A%0A            for n in range(m, len(unique_species)):%0A                species_2 = unique_species%5Bn%5D%0A                bond_list.append(%5Bspecies_1, species_2%5D)%0A
 %0A   
@@ -1669,32 +1669,39 @@
 es_2%5D)%0A%0A        
+return 
 bond_list = %5B%5D%0A 
@@ -1697,48 +1697,450 @@
 list
- = %5B%5D%0A        pass%0A        return bond_list
+%0A%0Aif __name__ == '__main__':%0A    # create simple structure%0A    lattice = np.eye(3)%0A    species = %5B'B', 'A'%5D%0A    positions = %5Bnp.array(%5B0, 0, 0%5D), np.array(%5B0.5, 0.5, 0.5%5D)%5D%0A    cutoff = np.linalg.norm(np.array(%5B0.5, 0.5, 0.5%5D)) + 0.001%0A%0A    test_structure = Structure(lattice, species, positions, cutoff)%0A%0A    # test species_to_bond%0A    print(test_structure.bond_list)%0A    assert(test_structure.bond_list == %5B%5B'B', 'B'%5D, %5B'B', 'A'%5D, %5B'A', 'A'%5D%5D)
 %0A

add bond_list method