@@ -5,48 +5,20 @@ Specifically, the parser passes the body of `cal` and `defcal` written in `OpenP
55It reuses the classical types and statements from ` openqasm3 ` .
66## Developing openpulse
77
8- ### Working with submodule
9-
10- The ` openpulse ` package depends on the ` openqasm3 ` package. This repo references the
11- [ OpenQASM] ( https://github.com/openqasm/openqasm ) repo as submodule.
12-
13- To clone ` openpulse ` , run:
14-
15- ```
16- git clone --recurse-submodules https://github.com/openqasm/openpulse-python.git
17- ```
18-
19- If you forgot ` --recurse-submodules ` during initial cloning, you can run:
20-
21- ```
22- git submodule update --init --recursive
23- ```
24-
25- ### Build and install openqasm3
26-
27- We assume that you have already installed ` Antlr4 ` tools following ` openqasm/source/openqasm/README.md `
28- and set up an Python virtual environment for this project.
29-
30- You will need to build and install ` openqasm3 ` first. Change to the ` openqasm/source/grammar `
31- directory and run:
32-
33- ```
34- antlr4 -o ../openqasm/openqasm3/antlr -Dlanguage=Python3 -visitor qasm3Lexer.g4 qasm3Parser.g4
35- ```
36-
37- Then change to the ` openqasm/source/openqasm ` directory and run:
8+ To install dependencies, change to ` source/openpulse ` directory and run:
389
3910```
40- python -mpip install -r requirements.txt -r requirements-dev.txt
41- python -mpip install -e ".[all]"
11+ python -m pip install -r requirements.txt -r requirements-dev.txt
4212```
4313
44- ### Working with openpulse
14+ To reuse classic statements/types, OpenPulse grammar imports OpenQASM grammar. When we update the
15+ OpenPulse grammar, we also need to copy the latest OpenQASM grammar from
16+ https://github.com/openqasm/openqasm/tree/main/source/grammar into the ` source/grammar ` directory.
4517
4618Now build the ` openpulse ` grammar. Change to the ` source/grammar ` directory and run:
4719
4820```
49- antlr4 -lib ../../openqasm/source/grammar - o ../openpulse/openpulse/antlr -Dlanguage=Python3 -visitor openpulseLexer.g4 openpulseParser.g4
21+ antlr4 -o ../openpulse/openpulse/antlr -Dlanguage=Python3 -visitor openpulseLexer.g4 openpulseParser.g4
5022```
5123
5224Finally, you can change to the ` source/openpulse ` directory and run:
0 commit comments