- Open the qat codespace, and if it errors from being out of memory, locally clone and use remote dev containers to create docker
- 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
- 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
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" }