tket icon indicating copy to clipboard operation
tket copied to clipboard

Make `RebaseCustom` more serialisable

Open yao-cqc opened this issue 11 months ago • 0 comments

Most of the backends now rely on RebaseCustom and RebaseSquash passes. Since these two passes take a circuit-to-circuit function (e.g. basis_tk2_replacement) as an argument, they can't be completely serialised. This behaviour makes some of our default passes non-(de)serialisable. However, since these circuit-to-circuit functions are usually built-in functions (e.g. TK2_using_CX) in tket, we should be able to make them more serialisable. One possible way is to override RebaseCustom and RebaseSquash to take an enum that points to one of the built-in functions.

Note that some TK1 transformations are implemented in python in _decompositions.py, which might make things trickier...

yao-cqc avatar Mar 25 '24 15:03 yao-cqc