コード例 #1
0
ファイル: onepdm_container.C プロジェクト: junyang4711/Block
void Onepdm_container::store_npdm_elements( const std::vector< std::pair< std::vector<int>, double > > & new_spin_orbital_elements)
{
  assert( new_spin_orbital_elements.size() == 2 );
  Onepdm_permutations perm;
  std::vector< std::pair< std::vector<int>, double > > spin_batch;
  // Work with the non-redundant elements only, and get all unique spin-permutations as a by-product
  perm.process_new_elements( new_spin_orbital_elements, nonredundant_elements, spin_batch );

  update_full_spin_array( spin_batch );
  update_full_spatial_array( spin_batch );
}
コード例 #2
0
ファイル: onepdm_container.C プロジェクト: sanshar/StackBlock
void Onepdm_container::store_npdm_elements( const std::vector< std::pair< std::vector<int>, double > > & new_spin_orbital_elements)
{
  Onepdm_permutations perm;
  if(dmrginp.spinAdapted())
  {
    std::vector< std::pair< std::vector<int>, double > > spatial_batch;
    perm.get_spatial_batch(new_spin_orbital_elements,spatial_batch);
    update_full_spatial_array(spatial_batch);
    if( store_full_spin_array_)
    {
      std::vector< std::pair< std::vector<int>, double > > spin_batch;
      perm.process_new_elements( new_spin_orbital_elements, nonredundant_elements, spin_batch );
      update_full_spin_array( spin_batch );
    }
  }
  else{
    std::vector< std::pair< std::vector<int>, double > > spin_batch;
    perm.process_new_elements( new_spin_orbital_elements, nonredundant_elements, spin_batch );
    update_full_spin_array( spin_batch );
  }
}