def spin_double(basis, lamdict):
    """
    Double the size of a basis to introduce spin to the problem.
    Go through the basis and create an identical copy with opposite spin and 
    incremented index such that the orbital basis order puts spin down in the first
    N/2 orbitals, and spin up in the second N/2.
    
    *args*:

        - **basis**: list of orbital objects
       
        - **lamdict**: dictionary of int:float pairs providing the
        spin-orbit coupling strength for the different inequivalent atoms in 
        basis.
    
    *return*:
    
        - doubled basis carrying all required spin information
        
    ***
    """
    LB = len(basis)
    basis_double = []
    for ind in range(LB):
        basis[ind].spin = -1
        basis[ind].lam = lamdict[basis[ind].atom]
        spin_up = basis[ind].copy()
        spin_up.spin = 1
        spin_up.index = basis[ind].index + LB
        basis_double.append(spin_up)
    return basis + basis_double
