sandialabs / pyGSTi

A python implementation of Gate Set Tomography
http://www.pygsti.info
Apache License 2.0
134 stars 56 forks source link

Cast gates to dense matrices in `optools` #414

Closed Timo1104 closed 6 months ago

Timo1104 commented 6 months ago

Description of changes

Minor change: in optools.entanglement_fidelity, accept both arrays and gates for the a and b arguments. The arguments are cast to (dense) arrays within the function scope.

Perform similar casting in other functions, that call a.shape.

Motivation

See also #406.

Since some update (cannot pinpoint which exactly), this casting was not done anymore, neither within optools.entanglement_fidelity, nor in any of the functions calling this one.

I've chosen to cast to dense array within optools.entanglement_fidelity, rather than before calling this function, for two reasons: