Hey, I have been following the instructions provided in the link below.
https://learn.microsoft.com/en-in/azure/quantum/how-to-submit-jobs?pivots=ide-python&tabs=tabid-python
my python code :
import qsharp
import azure.quantum
workspace = azure.quantum.Workspace(
resource_id = "myActualId",
location = "location"
)
qsharp.init(project_root = '/myrootfolder')
qsharp.init(target_profile=qsharp.TargetProfile.Base)
MyProgram = qsharp.compile("Sample.RandomNBits(4)")
MyTarget = workspace.get_targets("rigetti.sim.qvm")
job = MyTarget.submit(MyProgram, "MyPythonJob", shots=10)
results = job.get_results()
print("\nResults: ", results)
My source.qs file:
namespace Sample {
operation Random() : Result {
use q = Qubit();
H(q);
let result = M(q);
Reset(q);
return result
}
operation RandomNBits(N: Int): Result[] {
mutable results = [];
for i in 0 .. N - 1 {
let r = Random();
set results += [r];
}
return results
}
}
I'm Getting the following error :
ll_str = get_interpreter().qir(entry_expr)
module.QSharpError: Qsc.Resolve.NotFound
× name error
╰─▶ RandomNBits
not found
╭─[<entry>:1:1]
1 │ Sample.RandomNBits(4)
· ───────────
╰────
Qsc.TypeCk.AmbiguousTy
× type error
╰─▶ insufficient type information to infer type
╭─[<entry>:1:1]
1 │ Sample.RandomNBits(4)
· ─────────────────────
╰────
help: provide a type annotation Thanks for your help in advance ,