This is an annotated version of the original
Note: I removed the relative paths from the devcontainer on this branch https://github.com/craiglpeters/qat/tree/devcontainer-opt and now the
postCreateCommand
runs successfully on codespace startup
Note: I tested pre-builds... testing in progress
Note: Testing
postStartCommand
to adutomate the build of qat:"postStartCommand": "mkdir Debug ; cd Debug ; cmake .. ; make qat ; ./qir/qat/Apps/qat --apply --profile default -S ../qir/qir-tests/reduction_tests/inlining-input.ll"
- Open the qat codespace, and if it errors from being out of memory, locally clone and use remote dev containers to create docker
Note: I used an 8 core Codespace with no problems
- Build qat tool with instructions here: https://qir-alliance.github.io/qat/UserGuide/BuildingLibrary/#:~:text=Build%20instructions%20for%20users
mkdir Debug
cd Debug
cmake ..
make qat
Note: Try pre-builds to do this step ahead of time for users https://docs.github.com/en/codespaces/prebuilding-your-codespaces
- Try running the built executable with some test QIR in the test folders here: https://github.com/qir-alliance/qat/tree/main/qir/qir-tests
If you specifically use the inlining input
*.ll
file and the following options forqat
:
codespace ➜ /home/qat/Debug (main ✗) $ ./qir/qat/Apps/Qat --apply --profile default -S /home/qat/qir/qir-tests/reduction_tests/inlining-input.ll
Note: the executable
qat
is lower case Note: the path is/workspaces/qat/qir...
Then you should get the following output:
; ModuleID = 'qat-link'
source_filename = "qat-link"
%Qubit = type opaque
define void @SimpleLoop__Main() #0 {
entry:
call void @SimpleLoop__Main__body()
ret void
}
define internal void @SimpleLoop__Main__body() #1 {
entry:
call void @SimpleLoop__MiniCircuit__body(%Qubit* null, %Qubit* nonnull inttoptr (i64 1 to %Qubit*))
call void @SimpleLoop__MiniCircuit__body(%Qubit* null, %Qubit* nonnull inttoptr (i64 1 to %Qubit*))
ret void
}
define internal void @SimpleLoop__MiniCircuit__body(%Qubit* %q1, %Qubit* %q2) #2 {
entry:
call void @Microsoft__Quantum__Intrinsic__H__body(%Qubit* %q1)
call void @Microsoft__Quantum__Intrinsic__H__body(%Qubit* %q2)
call void @Microsoft__Quantum__Intrinsic__CNOT__body(%Qubit* %q1, %Qubit* %q2)
ret void
}
define internal void @Microsoft__Quantum__Intrinsic__H__body(%Qubit* %qubit) #2 {
entry:
call void @__quantum__qis__h__body(%Qubit* %qubit)
ret void
}
define internal void @Microsoft__Quantum__Intrinsic__CNOT__body(%Qubit* %control, %Qubit* %target) #2 {
entry:
call void @__quantum__qis__cnot__body(%Qubit* %control, %Qubit* %target)
ret void
}
declare void @__quantum__qis__cnot__body(%Qubit*, %Qubit*)
declare void @__quantum__qis__h__body(%Qubit*)
attributes #0 = { "EntryPoint" "maxQubitIndex"="0" "maxResultIndex"="0" "requiredQubits"="0" "requiredResults"="0" }
attributes #1 = { "maxQubitIndex"="1" "maxResultIndex"="0" "requiredQubits"="2" "requiredResults"="0" }
attributes #2 = { "maxQubitIndex"="0" "maxResultIndex"="0" "requiredQubits"="0" "requiredResults"="0" }