pyqir icon indicating copy to clipboard operation
pyqir copied to clipboard

Issues using ArrayType and StructType

Open skushnir123 opened this issue 1 year ago • 1 comments

I am finding it difficult to make use of ArrayType and StructType in PyQIR. It is not possible to directly instantiate these classes and it also seems impossible to subclass these types. (I get a TypeError: type 'builtins.ArrayType' is not an acceptable base type)

Additional context

The ArrayType seems to be of central importance in defining QIR programs. For example, If I want to write a QFT function (using the FunctionType) and pass in an array of qubits, this seems impossible as I cannot specify an ArrayType as a parameter to the Function.

Please let me know if I am missing something or if this is not the intended use case of PyQIR.

skushnir123 avatar Jan 30 '24 17:01 skushnir123

Could you provide an example of what you have in mind? Like some Python code?

ausbin avatar Jun 03 '24 22:06 ausbin