QuTech-Delft / OpenSquirrel

A flexible (Python-based) quantum program compiler
Apache License 2.0
4 stars 1 forks source link

208 axis object #223

Closed S-Linde closed 2 months ago

S-Linde commented 2 months ago

This merge request contains the following:

An Axis object can take most input that resembles an axis and create an Axis from it. For example Axis((1,2,3)), Axis(1,2,3), Axis(1.0, 2.0, 3.0), Axis(np.array([1,2,3])) and Axis([[1],[2],[3]]) are all valid and result in equal axis objects. During initialization and setting of the Axis.axis property, the underlying 1DArray is normalized. Hence, an Axis object is always normalized.

The Axis object is used for the internal representation. It is allowed for a user to give an Axis object to anything method that accept an AxisLike as input. However, this is not mandatory nor should it be incentivized.

Closes #208