Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion: Unnamed expressions not supported by QUIRGen yet when compiling nadder_n4.qasm test #35

Open
kitbarton opened this issue Jan 31, 2023 · 2 comments

Comments

@kitbarton
Copy link
Collaborator

I'm seeing the following assertion error when compiling the adder_n4.qasm test from the QASMBench Benchmark Suite

File: "qelib1.inc", Line: 220, Col: 5 ASTGateQOp c3sqrtx does not have a Local SymbolTable Entry.
OK.
loc("small/adder_n4/adder_n4.qasm":10:25): error: Unnamed expressions not supported by QUIRGen yet, assign to an identifier
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /Users/kbarton/bin/qss-compiler --emit=qem -o test.qem -I . small/adder_n4/adder_n4.qasm
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  qss-compiler             0x00000001071ddc54 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  qss-compiler             0x00000001071dcc4c llvm::sys::RunSignalHandlers() + 112
2  qss-compiler             0x00000001071de2e0 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x000000019e2bf2a4 _sigtramp + 56
4  qss-compiler             0x00000001071066d4 mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::DictionaryAttr, mlir::BlockRange, unsigned int) + 560
5  qss-compiler             0x00000001071066d4 mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::DictionaryAttr, mlir::BlockRange, unsigned int) + 560
6  qss-compiler             0x00000001071068b0 mlir::Operation::create(mlir::OperationState const&) + 168
7  qss-compiler             0x00000001070a69c4 mlir::OpBuilder::createOperation(mlir::OperationState const&) + 28
8  qss-compiler             0x0000000105148978 mlir::quir::Builtin_UOp mlir::OpBuilder::create<mlir::quir::Builtin_UOp, mlir::Value&, mlir::Value&, mlir::Value&, mlir::Value&>(mlir::Location, mlir::Value&, mlir::Value&, mlir::Value&, mlir::Value&) + 168
9  qss-compiler             0x0000000105148760 qssc::frontend::openqasm3::QUIRGenQASM3Visitor::visit(QASM::ASTUGateOpNode const*) + 1124
10 qss-compiler             0x0000000105146fb0 qssc::frontend::openqasm3::QUIRGenQASM3Visitor::visit(QASM::ASTGateDeclarationNode const*) + 928
11 qss-compiler             0x0000000105135c2c qssc::frontend::openqasm3::BaseQASM3Visitor::visit(QASM::ASTStatementList const*) + 168
12 qss-compiler             0x0000000105142058 qssc::frontend::openqasm3::QUIRGenQASM3Visitor::walkAST() + 20
13 qss-compiler             0x0000000105134f04 qssc::frontend::openqasm3::parse(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool, bool, bool, mlir::ModuleOp&) + 788
14 qss-compiler             0x0000000104cb9d2c compile(int, char const**, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) + 2968
15 dyld                     0x000000019df67e50 start + 2544

This requires a recent version of qss-qasm to fix an issue in the Qasm parser (Jan 27, 2023 or newer).

Reproduce with the following command:

bin/qss-compiler --emit=qem -o test.qem -I . adder_n4.qasm

adder_n4.qasm.txt
qelib1.inc.txt

This error is preventing all the benchmarks from the QASMBench suite from building using the qss-compiler.

Note If you get the files directly from the QASMBench repo, you may need to run dos2unix on the files first to eliminate the Windows special characters in the file.

@kitbarton kitbarton changed the title Assertion failure when compiling nadder_n4.qasm test Assertion: Unnamed expressions not supported by QUIRGen yet when compiling nadder_n4.qasm test Feb 6, 2023
@taalexander
Copy link
Collaborator

Hi Kit, is this resolved by the latest QASM fix?

@kitbarton
Copy link
Collaborator Author

Hi Kit, is this resolved by the latest QASM fix?

No, unfortunately it is not. The QASM fix is necessary to get far enough into the compile to hit this assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants