Skip to content
  • Joseph Weston's avatar
    implement operator vectorization · 51d678bf
    Joseph Weston authored
    This includes the following changes:
    
    + Group the elements of 'where' according to the term/site-families
      they belong to. This is pre-computed and stored in '_terms'.
      What specifically is stored depends on whether vectorization
      is enabled.
    + BlockSparseMatrix now takes its matrix elements as a sequence
      of pairs 'which, data', where 'which' indexes 'where'. This
      leverages the values stored in '_terms'.
    + Normalize 'onsite' to a function that takes 'site_range' (int)
      and 'site_offsets' (array of int). This facilitates vectorization
      when it is enabled. Previously 'onsite' was normalized to a
    function
      taking 'site' (int), which was not vectorizable.
    + '_eval_onsite' is modified to compose components of '_terms' with
      'onsite'.
    + '_eval_hamiltonian' is modified to compose compoenents of '_terms'
      with 'hamiltonian_term' when vectorized, or 'hamiltonian' when
      not vectorized.
    51d678bf