microsoft / qsharp-language

Official repository for design of the quantum programming language Q# and its core libraries
MIT License
233 stars 54 forks source link

Description lacks the limitations: __quantum__rt__array_concatenate #75

Closed kuzminrobin closed 3 years ago

kuzminrobin commented 3 years ago

(I'm relatively new to this code base and I may be comparing unrelated things)

The Data Type Representation page does not mention that the __quantum__rt__array_concatenate function is only applicable for
1-dimenstional arrays,
in both arrays the elements must have the same size in bytes;

whereas the implementation of QirArray* quantum__rt__array_concatenate(QirArray* head, QirArray* tail) in src/QirRuntime/lib/QIR/arrays.cpp requires 1 dimension:
assert(head->dimensions == 1 && tail->dimensions == 1).
It also calls concatenated->Append(tail) which contains: assert(this->itemSizeInBytes == other->itemSizeInBytes).

The documentation for __quantum__rt__array_concatenate (in Data Type Representation) likely needs to mention those limitations.

bettinaheim commented 3 years ago

Resolved with #54.