From a381df67235eaeb12f5359733a8941cde1f287e4 Mon Sep 17 00:00:00 2001 From: Alec Edgington <54802828+cqc-alec@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:03:41 +0100 Subject: [PATCH] Set maximum bit width for classical operations according to pytket support (#190) * Set maximum bit width for classical operations according to pytket support. --- pytket/phir/phirgen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytket/phir/phirgen.py b/pytket/phir/phirgen.py index ff1fc04..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 ( @@ -44,7 +45,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]