CQCL / pytket-qir

Public repo for the pytket-qir package
Apache License 2.0
6 stars 1 forks source link

update registerhandling to use i1* pointer #61

Closed cqc-melf closed 1 year ago

cqc-melf commented 1 year ago

The discussed changes for the classical register handling

cqc-melf commented 1 year ago

I think we talked about settling on better names for the API functions. I have left some suggestions. Perhaps it makes sense to list them out all together:

i1*  create_creg      (i64 size                     )
void set_creg_to_int  (i1* creg, i64 value          )
i64  get_int_from_creg(i1* creg                     )
void set_creg_bit     (i1* creg, i64 index, i1 value)
i1   get_creg_bit     (i1* creg, i64 index          )

Note that in the backend compiler, a notion of creg is prevalent so perhaps it makes sense to also use it for this API.

I am open to hear about other suggestions. cc: @peter-campora

I have done a search and replace as suggested, I have replaced that in all of the ll files for the tests as well.

See @cqc-melf rename functions as suggested 867e2a8

And @cqc-melf rename reg to creg in comments 3a4cfdd