Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace cudaq {
/// computation jobs.
class IonQServerHelper : public ServerHelper {
static constexpr const char *DEFAULT_URL = "https://api.ionq.co";
static constexpr const char *DEFAULT_VERSION = "v0.3";
static constexpr const char *DEFAULT_VERSION = "v0.4";

public:
/// @brief Returns the name of the server helper.
Expand Down Expand Up @@ -120,8 +120,8 @@ void IonQServerHelper::initialize(BackendConfig config) {
parseConfigForCommonParams(config);

// Enable debiasing
if (config.find("debias") != config.end())
backendConfig["debias"] = config["debias"];
if (config.find("debiasing") != config.end())
backendConfig["debiasing"] = config["debiasing"];
if (config.find("sharpen") != config.end())
backendConfig["sharpen"] = config["sharpen"];
if (config.find("format") != config.end())
Expand Down Expand Up @@ -204,14 +204,14 @@ IonQServerHelper::createJob(std::vector<KernelExecution> &circuitCodes) {
job["input"]["format"] = "qir";
job["input"]["data"] = circuitCode.code;
// Include error mitigation configuration if set in backendConfig
if (keyExists("debias")) {
if (keyExists("debiasing")) {
try {
bool debiasValue =
nlohmann::json::parse(backendConfig["debias"]).get<bool>();
job["error_mitigation"]["debias"] = debiasValue;
bool debiasingValue =
nlohmann::json::parse(backendConfig["debiasing"]).get<bool>();
job["error_mitigation"]["debiasing"] = debiasingValue;
} catch (const nlohmann::json::exception &e) {
throw std::runtime_error(
"Invalid value for 'debias'. It should be a boolean (true/false).");
"Invalid value for 'debiasing'. It should be a boolean (true/false).");
}
}

Expand Down
8 changes: 4 additions & 4 deletions utils/mock_qpu/ionq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def login(token: Union[str, None] = Header(alias="Authorization",
# Here we expose a way to post jobs,
# Must have a Access Token, Job Program must be Adaptive Profile
# with entry_point tag
@app.post("/v0.3/jobs")
@app.post("/v0.4/jobs")
async def postJob(job: Job,
token: Union[str, None] = Header(alias="Authorization",
default=None)):
Expand Down Expand Up @@ -138,7 +138,7 @@ async def postJob(job: Job,

# Retrieve the job, simulate having to wait by counting to 3
# until we return the job results
@app.get("/v0.3/jobs")
@app.get("/v0.4/jobs")
async def getJob(id: str):
global countJobGetRequests, createdJobs, numQubitsRequired

Expand All @@ -152,13 +152,13 @@ async def getJob(id: str):
"jobs": [{
"status": "completed",
"qubits": numQubitsRequired,
"results_url": "/v0.3/jobs/{}/results".format(id)
"results_url": "/v0.4/jobs/{}/results".format(id)
}]
}
return res


@app.get("/v0.3/jobs/{jobId}/results")
@app.get("/v0.4/jobs/{jobId}/results")
async def getResults(jobId: str):
global countJobGetRequests, createdJobs

Expand Down
Loading