Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/support ionq #249

Merged
merged 24 commits into from
Sep 2, 2024
Merged
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
2 changes: 2 additions & 0 deletions generated/api-nisq/models/analysis-job-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ export type AnalysisJobDto = {
time?: string;
inputParameters?: Map<string, string>;
ready?: boolean;
initialMcdaJob?: string;
initialMcdaMethod?: string;
_links?: Links;
};
26 changes: 4 additions & 22 deletions generated/api-nisq/models/analysis-result-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,11 @@
import { ImplementationDto } from './implementation-dto';
import { Links } from './links';
export type AnalysisResultDto = {
id?: string;
provider?: string;
qpu?: string;
compiler?: string;
analyzedDepth?: number;
analyzedWidth?: number;
analyzedTotalNumberOfOperations?: number;
analyzedNumberOfSingleQubitGates?: number;
analyzedNumberOfMultiQubitGates?: number;
analyzedNumberOfMeasurementOperations?: number;
analyzedMultiQubitGateDepth?: number;
numberOfQubits?: number;
t1?: number;
t2?: number;
avgReadoutError?: number;
avgSingleQubitGateError?: number;
avgMultiQubitGateError?: number;
avgSingleQubitGateTime?: number;
avgMultiQubitGateTime?: number;
maxGateTime?: number;
simulator?: boolean;
time?: string;
implementation?: ImplementationDto;
id?: string;
inputParameters?: {};
originalCircuitResultId?: string;
qpuSelectionJobId?: string;
correlationId?: string;
_links?: Links;
};
2 changes: 1 addition & 1 deletion generated/api-nisq/models/compiler-selection-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export type CompilerSelectionDto = {
circuitName?: string;
circuitUrl?: string;
qasmCode?: string;
token?: string;
tokens?: Map<string, string>;
refreshToken?: string;
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* tslint:disable */
export type ExecuteAnalysisResultRequestDto = {
refreshToken?: string;
token?: string;
tokens?: {};
correlationId?: string;
};
1 change: 1 addition & 0 deletions generated/api-nisq/models/execution-result-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export type ExecutionResultDto = {
result?: string;
shots?: number;
histogramIntersectionValue?: number;
resultLocation?: string;
_links?: Links;
};
1 change: 0 additions & 1 deletion generated/api-nisq/models/implementation-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type ImplementationDto = {
implementedAlgorithm?: string;
algorithmName?: string;
language?: string;
selectionRule?: string;
sdk?: string;
fileLocation?: string;
inputParameters?: ParameterListDto;
Expand Down
11 changes: 11 additions & 0 deletions generated/api-nisq/models/selection-request-dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
/* tslint:disable */
export type SelectionRequestDto = {
parameters?: {};
allowedProviders?: Array<string>;
compilers?: Array<string>;
preciseResultsPreference?: boolean;
shortWaitingTimesPreference?: boolean;
queueImportanceRatio?: number;
maxNumberOfCompiledCircuits?: number;
predictionAlgorithm?: string;
metaOptimizer?: string;
tokens?: {};
algorithmId?: string;
refreshToken?: string;
mcdaMethodName?: string;
mcdaWeightLearningMethod?: string;
};
69 changes: 2 additions & 67 deletions generated/api-nisq/services/analysis-result.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { AnalysisJobDto } from '../models/analysis-job-dto';
import { AnalysisJobListDto } from '../models/analysis-job-list-dto';
import { AnalysisResultDto } from '../models/analysis-result-dto';
import { AnalysisResultListDto } from '../models/analysis-result-list-dto';
import { ExecuteAnalysisResultRequestDto } from '../models/execute-analysis-result-request-dto';
import { ExecutionResultDto } from '../models/execution-result-dto';

@Injectable({
providedIn: 'root',
Expand Down Expand Up @@ -99,7 +97,7 @@ export class AnalysisResultService extends BaseService {
static readonly GetAnalysisJobsPath = '/analysis-results/jobs';

/**
* Retrieve all compiler analysis jobs
* Retrieve all analysis jobs
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `getAnalysisJobs()` instead.
Expand Down Expand Up @@ -132,7 +130,7 @@ export class AnalysisResultService extends BaseService {
}

/**
* Retrieve all compiler analysis jobs
* Retrieve all analysis jobs
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `getAnalysisJobs$Response()` instead.
Expand Down Expand Up @@ -326,67 +324,4 @@ export class AnalysisResultService extends BaseService {
)
);
}

/**
* Path part for operation executeAnalysisResult
*/
static readonly ExecuteAnalysisResultPath =
'/analysis-results/{resId}/execute';

/**
* Execute an analysis configuration
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `executeAnalysisResult()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
executeAnalysisResult$Response(params: {
resId: string;
body?: ExecuteAnalysisResultRequestDto;
}): Observable<StrictHttpResponse<ExecutionResultDto>> {
const rb = new RequestBuilder(
this.rootUrl,
AnalysisResultService.ExecuteAnalysisResultPath,
'post'
);
if (params) {
rb.path('resId', params.resId, {});

rb.body(params.body, 'application/json');
}
return this.http
.request(
rb.build({
responseType: 'json',
accept: 'application/hal+json',
})
)
.pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<ExecutionResultDto>;
})
);
}

/**
* Execute an analysis configuration
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `executeAnalysisResult$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
executeAnalysisResult(params: {
resId: string;
body?: ExecuteAnalysisResultRequestDto;
}): Observable<ExecutionResultDto> {
return this.executeAnalysisResult$Response(params).pipe(
map(
(r: StrictHttpResponse<ExecutionResultDto>) =>
r.body as ExecutionResultDto
)
);
}
}
10 changes: 6 additions & 4 deletions generated/api-nisq/services/compiler-analysis-result.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export class CompilerAnalysisResultService extends BaseService {
*
* This method doesn't expect any request body.
*/
getCompilerAnalysisResults(params?: {}): Observable<CompilerAnalysisResultListDto> {
getCompilerAnalysisResults(params?: {}): Observable<
CompilerAnalysisResultListDto
> {
return this.getCompilerAnalysisResults$Response(params).pipe(
map(
(r: StrictHttpResponse<CompilerAnalysisResultListDto>) =>
Expand Down Expand Up @@ -264,7 +266,7 @@ export class CompilerAnalysisResultService extends BaseService {
*/
executeCompilationResult$Response(params: {
resId: string;
token: string;
tokens: Map<string, string>;
}): Observable<StrictHttpResponse<ExecutionResultDto>> {
const rb = new RequestBuilder(
this.rootUrl,
Expand All @@ -273,7 +275,7 @@ export class CompilerAnalysisResultService extends BaseService {
);
if (params) {
rb.path('resId', params.resId, {});
rb.query('token', params.token, {});
rb.query('tokens', params.tokens, {});
}
return this.http
.request(
Expand All @@ -300,7 +302,7 @@ export class CompilerAnalysisResultService extends BaseService {
*/
executeCompilationResult(params: {
resId: string;
token: string;
tokens: Map<string, string>;
}): Observable<ExecutionResultDto> {
return this.executeCompilationResult$Response(params).pipe(
map(
Expand Down
12 changes: 7 additions & 5 deletions generated/api-nisq/services/qpu-selection-result.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { RequestBuilder } from '../request-builder';
import { Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';

import { ExecuteAnalysisResultRequestDto } from '../models/execute-analysis-result-request-dto';
import { ExecutionResultDto } from '../models/execution-result-dto';
import { QpuSelectionJobDto } from '../models/qpu-selection-job-dto';
import { QpuSelectionJobListDto } from '../models/qpu-selection-job-list-dto';
Expand Down Expand Up @@ -273,11 +274,11 @@ export class QpuSelectionResultService extends BaseService {
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `executeQpuSelectionResult()` instead.
*
* This method doesn't expect any request body.
* This method sends `application/json` and handles request body of type `application/json`.
*/
executeQpuSelectionResult$Response(params: {
resId: string;
token: string;
body: ExecuteAnalysisResultRequestDto;
}): Observable<StrictHttpResponse<ExecutionResultDto>> {
const rb = new RequestBuilder(
this.rootUrl,
Expand All @@ -286,7 +287,8 @@ export class QpuSelectionResultService extends BaseService {
);
if (params) {
rb.path('resId', params.resId, {});
rb.query('token', params.token, {});

rb.body(params.body, 'application/json');
}
return this.http
.request(
Expand All @@ -309,11 +311,11 @@ export class QpuSelectionResultService extends BaseService {
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `executeQpuSelectionResult$Response()` instead.
*
* This method doesn't expect any request body.
* This method sends `application/json` and handles request body of type `application/json`.
*/
executeQpuSelectionResult(params: {
resId: string;
token: string;
body: ExecuteAnalysisResultRequestDto;
}): Observable<ExecutionResultDto> {
return this.executeQpuSelectionResult$Response(params).pipe(
map(
Expand Down
Loading
Loading