23 #ifndef COM_DAFER45_TBTK_SOLVER_BLOCK_DIAGONALIZER
24 #define COM_DAFER45_TBTK_SOLVER_BLOCK_DIAGONALIZER
26 #include "TBTK/BlockStructureDescriptor.h"
152 const Index &blockIndex,
154 const Index &intraBlockIndex
189 BlockStructureDescriptor blockStructureDescriptor;
192 std::vector<unsigned int> blockSizes;
195 std::vector<unsigned int> blockOffsets;
198 std::vector<unsigned int> eigenVectorSizes;
201 std::vector<unsigned int> eigenVectorOffsets;
207 bool parallelExecution;
226 this->selfConsistencyCallback = &selfConsistencyCallback;
230 this->maxIterations = maxIterations;
238 unsigned int block = blockStructureDescriptor.getBlockIndex(state);
239 unsigned int offset = eigenVectorOffsets.at(block);
241 unsigned int firstStateInBlock
242 = blockStructureDescriptor.getFirstStateInBlock(block);
243 unsigned int lastStateInBlock = firstStateInBlock
244 + blockStructureDescriptor.getNumStatesInBlock(block)-1;
246 state - firstStateInBlock
247 )*blockStructureDescriptor.getNumStatesInBlock(block);
249 linearIndex >= firstStateInBlock
250 && linearIndex <= lastStateInBlock
253 offset + (linearIndex - firstStateInBlock)
262 const Index &blockIndex,
264 const Index &intraBlockIndex
268 unsigned int block = blockStructureDescriptor.getBlockIndex(
273 && state < (
int)blockStructureDescriptor.getNumStatesInBlock(
276 "BlockDiagonalizer::getAmplitude()",
277 "Out of bound error. The block with block Index "
279 << blockStructureDescriptor.getNumStatesInBlock(block)
280 <<
" states, but state " << state <<
" was requested.",
283 unsigned int offset = eigenVectorOffsets.at(block)
284 + state*blockStructureDescriptor.getNumStatesInBlock(block);
286 Index(blockIndex, intraBlockIndex)
289 return eigenVectors[offset + (linearIndex - firstStateInBlock)];
293 return eigenValues[state];
297 const Index &blockIndex,
304 return eigenValues[offset + state];
312 = blockStructureDescriptor.getBlockIndex(linearIndex);
314 return blockStructureDescriptor.getFirstStateInBlock(block);
322 = blockStructureDescriptor.getBlockIndex(linearIndex);
325 + blockStructureDescriptor.getNumStatesInBlock(block) - 1;
329 bool parallelExecution
331 this->parallelExecution = parallelExecution;