TRIQS / triqs

a Toolbox for Research on Interacting Quantum Systems
https://triqs.github.io
GNU General Public License v3.0
138 stars 72 forks source link

Tight binding tools: Bravais Lattice etc. in 1.2 #147

Closed phansmann closed 9 years ago

phansmann commented 9 years ago

Triqs 1.2 installation on a 64bit Ubuntu 14.04 machine (all tests passed):

Trying to transfer some notebooks which make use of tools in pytriqs.lattice.tight_binding I run into problems with "BravaisLattice". I copy a minimal example that produces the error from the documentation:

from pytriqs.lattice.tight_binding import *

# Define the Bravais Lattice : a square lattice in 2d
BL_1 = BravaisLattice(units = [(1,0,0) , (0,1,0) ], orbital_positions= {"":  (0,0,0)} )

gives

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-8a06c44b2173> in <module>()
      3 
      4 # Define the Bravais Lattice : a square lattice in 2d
----> 5 BL_1 = BravaisLattice(units = [(1,0,0) , (0,1,0) ], orbital_positions= {"":  (0,0,0)} )

TypeError: Error: no suitable C++ overload found in implementation of method BravaisLattice.__init__

 (no C++ name)(matrix<double> units, std::vector<r_t> orbital_positions, std::vector<std::string> atom_orb_name) ->  
 failed with the error : 
  Cannot convert to std::vector

Are the lattice tools updated/changed in 1.2? They are quite important/extremely convenient for me to create model Hamiltonians...

Cheers!

mferrero commented 9 years ago

Hey Philipp,

The syntax has slightly changed. Just try this:

from pytriqs.lattice.tight_binding import *
BL_1 = BravaisLattice(units = [(1,0,0), (0,1,0)], orbital_positions= [(0,0,0)] )
phansmann commented 9 years ago

That did it! Thank you!