I am trying to learn Q# and have very limited knowledge in Q#. As the title suggests, I am trying to pass an array of qubits into an operation
using a python script to call the operation which is written in Q#.
For Example: Consider the following Q# code:
operation SlightlyComplicated(register : Qubit[], pauli : String[]):
Bool { // Does something and returns a bool value
}
The above operation is saved in a file called Program.qs
which is saved in the same folder as the python code under the name TempQuant
and then here's the python code that is responsible for calling this operation:
import qsharp
from qsharp import Result
from Quantum.TempQuant import SlightlyComplicated
res = SlightlyComplicated.simulate(register = , pauli = ['X', 'Y', 'Z', 'Z'])
print(res)
Since pauli
is an array of Strings, it is easy to pass it through python since they share this type, but for types like qubit
, Result
, Pauli
(which are exclusively present in Q#), how am I supposed to pass them through python into their respective counterparts in Q#?
For reference, I am using Visual Studio Code to write the codes.