From a84830d25de42f83cf13e0d340aa77d78e7edea6 Mon Sep 17 00:00:00 2001 From: "S.S." <66886825+EarlMilktea@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:54:15 +0900 Subject: [PATCH] :bug: Fix broken file path Co-authored-by: thierry-martinez --- graphix/pattern.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphix/pattern.py b/graphix/pattern.py index d045582c..13a6734b 100644 --- a/graphix/pattern.py +++ b/graphix/pattern.py @@ -1525,7 +1525,7 @@ def to_qasm3(self, filename): filename : str file name to export to. example: "filename.qasm" """ - with Path(filename + ".qasm", "w").open(encoding="utf-8") as file: + with Path(filename).with_suffix(".qasm").open("w", encoding="utf-8") as file: file.write("// generated by graphix\n") file.write("OPENQASM 3;\n") file.write('include "stdgates.inc";\n')