From b73794021120ded4ecf651b7d5df3151f6fb8949 Mon Sep 17 00:00:00 2001 From: Melf Date: Tue, 5 Mar 2024 13:54:02 +0000 Subject: [PATCH 1/3] update error message for large classical registers --- pytket/qir/conversion/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytket/qir/conversion/api.py b/pytket/qir/conversion/api.py index 834fe412..2fb59581 100644 --- a/pytket/qir/conversion/api.py +++ b/pytket/qir/conversion/api.py @@ -77,7 +77,8 @@ def pytket_to_qir( for creg in circ.c_registers: if creg.size > 64: - raise ValueError("classical registers must not have more than 64 bits") + raise ValueError("""classical registers must not have more than 64 bits, + you could try to set cut_pytket_register=True in the conversion""") m = tketqirModule( name=name, From 25f9267504aa0af04a7bb88b4f4010c643ba8644 Mon Sep 17 00:00:00 2001 From: Melf Date: Tue, 5 Mar 2024 13:56:28 +0000 Subject: [PATCH 2/3] fix format --- pytket/qir/conversion/api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pytket/qir/conversion/api.py b/pytket/qir/conversion/api.py index 2fb59581..c049cbfd 100644 --- a/pytket/qir/conversion/api.py +++ b/pytket/qir/conversion/api.py @@ -77,8 +77,10 @@ def pytket_to_qir( for creg in circ.c_registers: if creg.size > 64: - raise ValueError("""classical registers must not have more than 64 bits, - you could try to set cut_pytket_register=True in the conversion""") + raise ValueError( + """classical registers must not have more than 64 bits, + you could try to set cut_pytket_register=True in the conversion""" + ) m = tketqirModule( name=name, From f12d22abcec2572a63780cfe497f2d8c37cff8e8 Mon Sep 17 00:00:00 2001 From: Melf Date: Tue, 5 Mar 2024 14:04:26 +0000 Subject: [PATCH 3/3] remove linebreak --- pytket/qir/conversion/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytket/qir/conversion/api.py b/pytket/qir/conversion/api.py index c049cbfd..78fe54b9 100644 --- a/pytket/qir/conversion/api.py +++ b/pytket/qir/conversion/api.py @@ -78,8 +78,8 @@ def pytket_to_qir( for creg in circ.c_registers: if creg.size > 64: raise ValueError( - """classical registers must not have more than 64 bits, - you could try to set cut_pytket_register=True in the conversion""" + """classical registers must not have more than 64 bits, \ +you could try to set cut_pytket_register=True in the conversion""" ) m = tketqirModule(