From 6280cb9154772c823f4b4bc7fb179c5efc6b2f54 Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Tue, 18 Jun 2024 11:29:31 +0100 Subject: [PATCH 1/2] Set maximum bit width for classical operations according to pytket support. --- pytket/phir/phirgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytket/phir/phirgen.py b/pytket/phir/phirgen.py index ff1fc04..c4442e6 100644 --- a/pytket/phir/phirgen.py +++ b/pytket/phir/phirgen.py @@ -44,7 +44,7 @@ "version": "0.1.0", "metadata": {"source": f'pytket-phir v{version("pytket-phir").split("+")[0]}'}, } -UINTMAX = 2**32 - 1 +UINTMAX = 2 ** (64 if pytket.__dict__.get("bit_width_64", False) else 32) - 1 Var: TypeAlias = str Bit: TypeAlias = list[Var | int] # e.g. [c, 0] for c[0] From 64eb7a8c2d7b07651b40e0bf58d8feee752c78df Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Tue, 18 Jun 2024 11:39:54 +0100 Subject: [PATCH 2/2] Add missing import. --- pytket/phir/phirgen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytket/phir/phirgen.py b/pytket/phir/phirgen.py index c4442e6..fd2f513 100644 --- a/pytket/phir/phirgen.py +++ b/pytket/phir/phirgen.py @@ -16,6 +16,7 @@ from typing_extensions import assert_never +import pytket import pytket.circuit as tk from phir.model import PHIRModel from pytket.circuit.logic_exp import (