Open
Description
Describe the bug
template <class Type>
QubitRegister<Type>::QubitRegister(std::size_t new_num_qubits, Type *state,
std::size_t tmp_spacesize_)
{
imported_state = true;
Initialize(new_num_qubits, tmp_spacesize_);
this->state = state;
}
has two problems:
- it doesn't initialize all needed class variables, e.g. "specialized", so this flag is sometimes true, sometimes false
- it doesn't work if USE_MM_ALLOC is not defined -> memory crash
To Reproduce
Steps to reproduce the behavior:
Use the ctor and initialize the statevector with a prepared memory pointer, undef MM_USE_MALLOC
Fixes
- init all class variables in the declaration
- add code for undef USE_MM_MALLOC with a specialized AlignedAllocator to transport the memory block into state_storage
See my PR #57
Metadata
Metadata
Assignees
Labels
No labels