From b725861c7f569b7ec6c8d46f982ef7761953000d Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Thu, 23 Nov 2023 17:41:40 +0100 Subject: [PATCH 01/23] adapt token handling for multiple provider --- .../api-nisq/models/compiler-selection-dto.ts | 2 +- .../execute-analysis-result-request-dto.ts | 2 +- .../api-nisq/models/qpu-selection-dto.ts | 2 +- .../compiler-analysis-result.service.ts | 10 +- .../services/qpu-selection-result.service.ts | 12 +- generated/api-nisq/services/root.service.ts | 191 +----------------- .../services/xmcda-criteria.service.ts | 12 +- ...ementation-execution-dialog.component.html | 1 + ...alyzer-qpu-selection-dialog.component.html | 28 ++- ...analyzer-qpu-selection-dialog.component.ts | 142 +++++++------ ...implementation-token-dialog.component.html | 14 +- .../implementation-token-dialog.component.ts | 25 ++- .../implementation-execution.component.ts | 13 +- ...n-nisq-analyzer-qpu-selection.component.ts | 61 ++++-- .../nisq-analyzer/nisq-analyzer.component.ts | 8 +- .../nisq-analyzer/nisq-analyzer.service.ts | 7 +- 16 files changed, 218 insertions(+), 312 deletions(-) diff --git a/generated/api-nisq/models/compiler-selection-dto.ts b/generated/api-nisq/models/compiler-selection-dto.ts index f22e468c..0936154f 100644 --- a/generated/api-nisq/models/compiler-selection-dto.ts +++ b/generated/api-nisq/models/compiler-selection-dto.ts @@ -6,6 +6,6 @@ export type CompilerSelectionDto = { circuitName?: string; circuitUrl?: string; qasmCode?: string; - token?: string; + tokens?: Map; refreshToken?: string; }; diff --git a/generated/api-nisq/models/execute-analysis-result-request-dto.ts b/generated/api-nisq/models/execute-analysis-result-request-dto.ts index e94e3934..779d30d4 100644 --- a/generated/api-nisq/models/execute-analysis-result-request-dto.ts +++ b/generated/api-nisq/models/execute-analysis-result-request-dto.ts @@ -1,5 +1,5 @@ /* tslint:disable */ export type ExecuteAnalysisResultRequestDto = { refreshToken?: string; - token?: string; + tokens?: Map>; }; diff --git a/generated/api-nisq/models/qpu-selection-dto.ts b/generated/api-nisq/models/qpu-selection-dto.ts index 877400b5..207927ea 100644 --- a/generated/api-nisq/models/qpu-selection-dto.ts +++ b/generated/api-nisq/models/qpu-selection-dto.ts @@ -4,7 +4,7 @@ export type QpuSelectionDto = { circuitLanguage?: string; circuitUrl?: string; qasmCode?: string; - tokens?: {}; + tokens?: Map>; refreshToken?: string; circuitName?: string; preciseResultsPreference?: boolean; diff --git a/generated/api-nisq/services/compiler-analysis-result.service.ts b/generated/api-nisq/services/compiler-analysis-result.service.ts index cd8d2721..75d5b133 100644 --- a/generated/api-nisq/services/compiler-analysis-result.service.ts +++ b/generated/api-nisq/services/compiler-analysis-result.service.ts @@ -68,7 +68,9 @@ export class CompilerAnalysisResultService extends BaseService { * * This method doesn't expect any request body. */ - getCompilerAnalysisResults(params?: {}): Observable { + getCompilerAnalysisResults(params?: {}): Observable< + CompilerAnalysisResultListDto + > { return this.getCompilerAnalysisResults$Response(params).pipe( map( (r: StrictHttpResponse) => @@ -264,7 +266,7 @@ export class CompilerAnalysisResultService extends BaseService { */ executeCompilationResult$Response(params: { resId: string; - token: string; + tokens: Map; }): Observable> { const rb = new RequestBuilder( this.rootUrl, @@ -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( @@ -300,7 +302,7 @@ export class CompilerAnalysisResultService extends BaseService { */ executeCompilationResult(params: { resId: string; - token: string; + tokens: Map; }): Observable { return this.executeCompilationResult$Response(params).pipe( map( diff --git a/generated/api-nisq/services/qpu-selection-result.service.ts b/generated/api-nisq/services/qpu-selection-result.service.ts index 3afe765e..dddc7d35 100644 --- a/generated/api-nisq/services/qpu-selection-result.service.ts +++ b/generated/api-nisq/services/qpu-selection-result.service.ts @@ -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'; @@ -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> { const rb = new RequestBuilder( this.rootUrl, @@ -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( @@ -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 { return this.executeQpuSelectionResult$Response(params).pipe( map( diff --git a/generated/api-nisq/services/root.service.ts b/generated/api-nisq/services/root.service.ts index 1476f8b1..4950e02f 100644 --- a/generated/api-nisq/services/root.service.ts +++ b/generated/api-nisq/services/root.service.ts @@ -90,12 +90,7 @@ export class RootService extends BaseService { * This method sends `multipart/form-data` and handles request body of type `multipart/form-data`. */ selectCompilerForFile1$FormData$Response(params: { - providerName: string; - qpuName: string; - circuitLanguage: string; - circuitName: string; - token: string; - body: { circuit?: Blob }; + body: { compilerSelectionDto?: CompilerSelectionDto; circuit?: Blob }; }): Observable> { const rb = new RequestBuilder( this.rootUrl, @@ -103,12 +98,6 @@ export class RootService extends BaseService { 'post' ); if (params) { - rb.query('providerName', params.providerName, {}); - rb.query('qpuName', params.qpuName, {}); - rb.query('circuitLanguage', params.circuitLanguage, {}); - rb.query('circuitName', params.circuitName, {}); - rb.query('token', params.token, {}); - rb.body(params.body, 'multipart/form-data'); } return this.http @@ -135,12 +124,7 @@ export class RootService extends BaseService { * This method sends `multipart/form-data` and handles request body of type `multipart/form-data`. */ selectCompilerForFile1$FormData(params: { - providerName: string; - qpuName: string; - circuitLanguage: string; - circuitName: string; - token: string; - body: { circuit?: Blob }; + body: { compilerSelectionDto?: CompilerSelectionDto; circuit?: Blob }; }): Observable { return this.selectCompilerForFile1$FormData$Response(params).pipe( map( @@ -159,11 +143,6 @@ export class RootService extends BaseService { * This method sends `application/xml` and handles request body of type `application/xml`. */ selectCompilerForFile1$Xml$Response(params: { - providerName: string; - qpuName: string; - circuitLanguage: string; - circuitName: string; - token: string; body: CompilerSelectionDto; }): Observable> { const rb = new RequestBuilder( @@ -172,12 +151,6 @@ export class RootService extends BaseService { 'post' ); if (params) { - rb.query('providerName', params.providerName, {}); - rb.query('qpuName', params.qpuName, {}); - rb.query('circuitLanguage', params.circuitLanguage, {}); - rb.query('circuitName', params.circuitName, {}); - rb.query('token', params.token, {}); - rb.body(params.body, 'application/xml'); } return this.http @@ -204,11 +177,6 @@ export class RootService extends BaseService { * This method sends `application/xml` and handles request body of type `application/xml`. */ selectCompilerForFile1$Xml(params: { - providerName: string; - qpuName: string; - circuitLanguage: string; - circuitName: string; - token: string; body: CompilerSelectionDto; }): Observable { return this.selectCompilerForFile1$Xml$Response(params).pipe( @@ -228,11 +196,6 @@ export class RootService extends BaseService { * This method sends `application/json` and handles request body of type `application/json`. */ selectCompilerForFile1$Json$Response(params: { - providerName: string; - qpuName: string; - circuitLanguage: string; - circuitName: string; - token: string; body: CompilerSelectionDto; }): Observable> { const rb = new RequestBuilder( @@ -241,12 +204,6 @@ export class RootService extends BaseService { 'post' ); if (params) { - rb.query('providerName', params.providerName, {}); - rb.query('qpuName', params.qpuName, {}); - rb.query('circuitLanguage', params.circuitLanguage, {}); - rb.query('circuitName', params.circuitName, {}); - rb.query('token', params.token, {}); - rb.body(params.body, 'application/json'); } return this.http @@ -273,11 +230,6 @@ export class RootService extends BaseService { * This method sends `application/json` and handles request body of type `application/json`. */ selectCompilerForFile1$Json(params: { - providerName: string; - qpuName: string; - circuitLanguage: string; - circuitName: string; - token: string; body: CompilerSelectionDto; }): Observable { return this.selectCompilerForFile1$Json$Response(params).pipe( @@ -355,19 +307,7 @@ export class RootService extends BaseService { * This method sends `multipart/form-data` and handles request body of type `multipart/form-data`. */ selectQpuForCircuitFile1$FormData$Response(params: { - allowedProviders: Array; - circuitLanguage: string; - tokens: {}; - circuitName?: string; - userId?: string; - preciseResultsPreference?: boolean; - shortWaitingTimesPreference?: boolean; - queueImportanceRatio?: number; - maxNumberOfCompiledCircuits?: number; - predictionAlgorithm?: string; - metaOptimizer?: string; - compilers?: Array; - body: { circuit?: Blob }; + body: { qpuSelectionDto?: QpuSelectionDto; circuit?: Blob }; }): Observable> { const rb = new RequestBuilder( this.rootUrl, @@ -375,27 +315,6 @@ export class RootService extends BaseService { 'post' ); if (params) { - rb.query('allowedProviders', params.allowedProviders, {}); - rb.query('circuitLanguage', params.circuitLanguage, {}); - rb.query('tokens', params.tokens, {}); - rb.query('circuitName', params.circuitName, {}); - rb.query('userId', params.userId, {}); - rb.query('preciseResultsPreference', params.preciseResultsPreference, {}); - rb.query( - 'shortWaitingTimesPreference', - params.shortWaitingTimesPreference, - {} - ); - rb.query('queueImportanceRatio', params.queueImportanceRatio, {}); - rb.query( - 'maxNumberOfCompiledCircuits', - params.maxNumberOfCompiledCircuits, - {} - ); - rb.query('predictionAlgorithm', params.predictionAlgorithm, {}); - rb.query('metaOptimizer', params.metaOptimizer, {}); - rb.query('compilers', params.compilers, {}); - rb.body(params.body, 'multipart/form-data'); } return this.http @@ -422,19 +341,7 @@ export class RootService extends BaseService { * This method sends `multipart/form-data` and handles request body of type `multipart/form-data`. */ selectQpuForCircuitFile1$FormData(params: { - allowedProviders: Array; - circuitLanguage: string; - tokens: {}; - circuitName?: string; - userId?: string; - preciseResultsPreference?: boolean; - shortWaitingTimesPreference?: boolean; - queueImportanceRatio?: number; - maxNumberOfCompiledCircuits?: number; - predictionAlgorithm?: string; - metaOptimizer?: string; - compilers?: Array; - body: { circuit?: Blob }; + body: { qpuSelectionDto?: QpuSelectionDto; circuit?: Blob }; }): Observable { return this.selectQpuForCircuitFile1$FormData$Response(params).pipe( map( @@ -453,18 +360,6 @@ export class RootService extends BaseService { * This method sends `application/xml` and handles request body of type `application/xml`. */ selectQpuForCircuitFile1$Xml$Response(params: { - allowedProviders: Array; - circuitLanguage: string; - tokens: {}; - circuitName?: string; - userId?: string; - preciseResultsPreference?: boolean; - shortWaitingTimesPreference?: boolean; - queueImportanceRatio?: number; - maxNumberOfCompiledCircuits?: number; - predictionAlgorithm?: string; - metaOptimizer?: string; - compilers?: Array; body: QpuSelectionDto; }): Observable> { const rb = new RequestBuilder( @@ -473,27 +368,6 @@ export class RootService extends BaseService { 'post' ); if (params) { - rb.query('allowedProviders', params.allowedProviders, {}); - rb.query('circuitLanguage', params.circuitLanguage, {}); - rb.query('tokens', params.tokens, {}); - rb.query('circuitName', params.circuitName, {}); - rb.query('userId', params.userId, {}); - rb.query('preciseResultsPreference', params.preciseResultsPreference, {}); - rb.query( - 'shortWaitingTimesPreference', - params.shortWaitingTimesPreference, - {} - ); - rb.query('queueImportanceRatio', params.queueImportanceRatio, {}); - rb.query( - 'maxNumberOfCompiledCircuits', - params.maxNumberOfCompiledCircuits, - {} - ); - rb.query('predictionAlgorithm', params.predictionAlgorithm, {}); - rb.query('metaOptimizer', params.metaOptimizer, {}); - rb.query('compilers', params.compilers, {}); - rb.body(params.body, 'application/xml'); } return this.http @@ -520,18 +394,6 @@ export class RootService extends BaseService { * This method sends `application/xml` and handles request body of type `application/xml`. */ selectQpuForCircuitFile1$Xml(params: { - allowedProviders: Array; - circuitLanguage: string; - tokens: {}; - circuitName?: string; - userId?: string; - preciseResultsPreference?: boolean; - shortWaitingTimesPreference?: boolean; - queueImportanceRatio?: number; - maxNumberOfCompiledCircuits?: number; - predictionAlgorithm?: string; - metaOptimizer?: string; - compilers?: Array; body: QpuSelectionDto; }): Observable { return this.selectQpuForCircuitFile1$Xml$Response(params).pipe( @@ -551,18 +413,6 @@ export class RootService extends BaseService { * This method sends `application/json` and handles request body of type `application/json`. */ selectQpuForCircuitFile1$Json$Response(params: { - allowedProviders: Array; - circuitLanguage: string; - tokens: {}; - circuitName?: string; - userId?: string; - preciseResultsPreference?: boolean; - shortWaitingTimesPreference?: boolean; - queueImportanceRatio?: number; - maxNumberOfCompiledCircuits?: number; - predictionAlgorithm?: string; - metaOptimizer?: string; - compilers?: Array; body: QpuSelectionDto; }): Observable> { const rb = new RequestBuilder( @@ -571,27 +421,6 @@ export class RootService extends BaseService { 'post' ); if (params) { - rb.query('allowedProviders', params.allowedProviders, {}); - rb.query('circuitLanguage', params.circuitLanguage, {}); - rb.query('tokens', params.tokens, {}); - rb.query('circuitName', params.circuitName, {}); - rb.query('userId', params.userId, {}); - rb.query('preciseResultsPreference', params.preciseResultsPreference, {}); - rb.query( - 'shortWaitingTimesPreference', - params.shortWaitingTimesPreference, - {} - ); - rb.query('queueImportanceRatio', params.queueImportanceRatio, {}); - rb.query( - 'maxNumberOfCompiledCircuits', - params.maxNumberOfCompiledCircuits, - {} - ); - rb.query('predictionAlgorithm', params.predictionAlgorithm, {}); - rb.query('metaOptimizer', params.metaOptimizer, {}); - rb.query('compilers', params.compilers, {}); - rb.body(params.body, 'application/json'); } return this.http @@ -618,18 +447,6 @@ export class RootService extends BaseService { * This method sends `application/json` and handles request body of type `application/json`. */ selectQpuForCircuitFile1$Json(params: { - allowedProviders: Array; - circuitLanguage: string; - tokens: {}; - circuitName?: string; - userId?: string; - preciseResultsPreference?: boolean; - shortWaitingTimesPreference?: boolean; - queueImportanceRatio?: number; - maxNumberOfCompiledCircuits?: number; - predictionAlgorithm?: string; - metaOptimizer?: string; - compilers?: Array; body: QpuSelectionDto; }): Observable { return this.selectQpuForCircuitFile1$Json$Response(params).pipe( diff --git a/generated/api-nisq/services/xmcda-criteria.service.ts b/generated/api-nisq/services/xmcda-criteria.service.ts index ed401b8e..3029b3bd 100644 --- a/generated/api-nisq/services/xmcda-criteria.service.ts +++ b/generated/api-nisq/services/xmcda-criteria.service.ts @@ -74,7 +74,9 @@ export class XmcdaCriteriaService extends BaseService { * * This method doesn't expect any request body. */ - getSupportedPrioritizationMethods(params?: {}): Observable { + getSupportedPrioritizationMethods(params?: {}): Observable< + McdaMethodListDto + > { return this.getSupportedPrioritizationMethods$Response(params).pipe( map( (r: StrictHttpResponse) => @@ -688,7 +690,9 @@ export class XmcdaCriteriaService extends BaseService { .pipe( filter((r: any) => r instanceof HttpResponse), map((r: HttpResponse) => { - return r as StrictHttpResponse; + return r as StrictHttpResponse< + CollectionModelEntityModelMcdaSensitivityAnalysisJob + >; }) ); } @@ -707,7 +711,9 @@ export class XmcdaCriteriaService extends BaseService { return this.getSensitivityAnalysisJobs$Response(params).pipe( map( ( - r: StrictHttpResponse + r: StrictHttpResponse< + CollectionModelEntityModelMcdaSensitivityAnalysisJob + > ) => r.body as CollectionModelEntityModelMcdaSensitivityAnalysisJob ) ); diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.html b/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.html index 82aaea17..ac44eefb 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.html +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.html @@ -6,6 +6,7 @@

{{data.title}}

IBMQ Rigetti + IonQ diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html index 380c7ae6..998db590 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html @@ -1,16 +1,26 @@

{{data.title}}

- - Vendor - - IBMQ - + Select vendor:
+ IBMQ +
+ + IBMQ Token + - - Token - + IonQ + + + AWS Access Key + + + + AWS Secret Key + +
Select preferences:
Short Waiting Time @@ -115,7 +125,7 @@

{{data.title}}

-
diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts index 1680eeb7..3237ee19 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts @@ -27,11 +27,12 @@ import { NisqAnalyzerService } from '../../../nisq-analyzer/nisq-analyzer.servic export class ImplementationNisqAnalyzerQpuSelectionDialogComponent implements OnInit { qpuSelectionFrom: FormGroup; - provider?: EntityModelProviderDto; + selectedVendors: string[] = []; ready?: boolean; - isIbmqSelected = true; selectedCompilers: string[] = []; + ibmqEnabled = true; + ionqEnabled = true; shortWaitingTimeEnabled = false; stableExecutionResultsEnabled = false; predictionAlgorithmInDialog = 'extra_trees_regressor'; @@ -52,12 +53,20 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent private utilService: UtilService ) {} - get vendor(): AbstractControl | null { - return this.qpuSelectionFrom.get('vendor'); + get vendors(): FormArray | null { + return this.qpuSelectionFrom.get('vendors') as FormArray; } - get token(): AbstractControl | null { - return this.qpuSelectionFrom.get('token'); + get ibmqToken(): AbstractControl | null { + return this.qpuSelectionFrom.get('ibmqToken'); + } + + get awsToken(): AbstractControl | null { + return this.qpuSelectionFrom.get('awsToken'); + } + + get awsSecretToken(): AbstractControl | null { + return this.qpuSelectionFrom.get('awsSecretToken'); } get compilers(): FormArray { @@ -90,11 +99,10 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent ngOnInit(): void { this.qpuSelectionFrom = new FormGroup({ - vendor: new FormControl(this.data.vendor, [ - // eslint-disable-next-line @typescript-eslint/unbound-method - Validators.required, - ]), - token: new FormControl(this.data.token), + vendors: new FormArray([]), + ibmqToken: new FormControl(this.data.ibmqToken), + awsToken: new FormControl(this.data.awsToken), + awsSecretToken: new FormControl(this.data.awsSecretToken), compilers: new FormArray([]), maxNumberOfCompiledCircuits: new FormControl( this.data.maxNumberOfCompiledCircuits, @@ -128,9 +136,11 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent ), }); - this.vendor.setValue('IBMQ'); - this.onVendorChanged(this.vendor.value); - this.setCompilerOptions(this.vendor.value); + this.selectedVendors = ['ibmq', 'ionq']; + for (const vendor of this.selectedVendors) { + this.vendors.push(new FormControl(vendor)); + } + this.setCompilerOptions(this.vendors.value); this.predictionAlgorithm.setValue('extra_trees_regressor'); this.metaOptimizer.setValue('ada_boost_regressor'); this.maxNumberOfCompiledCircuits.setValue(5); @@ -138,8 +148,7 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent this.shortWaitingTime.setValue(false); this.dialogRef.beforeClosed().subscribe(() => { - this.data.vendor = this.vendor.value; - this.data.token = this.token.value; + this.data.vendors = this.selectedVendors; this.data.selectedCompilers = this.selectedCompilers; this.data.maxNumberOfCompiledCircuits = this.maxNumberOfCompiledCircuitsDialog; this.data.metaOptimizer = this.metaOptimizerInDialog; @@ -147,6 +156,9 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent this.data.queueImportanceRatio = this.queueImportanceRatioDialog; this.data.shortWaitingTime = this.shortWaitingTimeEnabled; this.data.stableExecutionResults = this.stableExecutionResultsEnabled; + this.data.ibmqToken = this.ibmqToken.value; + this.data.awsToken = this.awsToken.value; + this.data.awsSecretToken = this.awsSecretToken.value; }); } @@ -154,41 +166,6 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent this.dialogRef.close(); } - isRequiredDataMissing(): boolean { - return this.vendor.errors?.required; - } - - onVendorChanged(value: string): void { - this.isIbmqSelected = true; - if (value === 'IBMQ') { - this.providerService.getProviders().subscribe((result) => { - this.getProviderDtoByName(result); - if (!this.provider) { - console.error('Provider with given name not found!'); - this.ready = true; - return; - } - this.setCompilerOptions(value); - }); - } else { - this.isIbmqSelected = false; - this.setCompilerOptions(value); - } - } - - getProviderDtoByName(result): void { - if (result === null) { - console.error('Error while loading provider!'); - return; - } - for (const providerDto of result._embedded.providerDtoes) { - if (providerDto.name.toLowerCase() === 'ibmq') { - this.provider = providerDto; - return; - } - } - } - updateCompilerSelection(compilerName: string, allowed: boolean): void { if (allowed) { this.selectedCompilers.push(compilerName); @@ -206,24 +183,57 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent return this.selectedCompilers.includes(compilerName); } - checkIfCompilersPresent(): boolean { - if (this.selectedCompilers.length > 0) { + checkIfCompilersAndProvidersPresent(): boolean { + if (this.selectedCompilers.length > 0 && this.selectedVendors.length > 0) { return true; } else { return false; } } - setCompilerOptions(vendor: string): void { - this.nisqAnalyzerService - .getCompilers(vendor) - .subscribe((availableCompilers) => { - this.selectedCompilers = availableCompilers; - this.compilers.clear(); - for (const compiler of availableCompilers) { - this.compilers.push(new FormControl(compiler)); - } - }); + setCompilerOptions(vendors: string[]): void { + debugger; + const setOfAllAvailableCompilers = new Set(); + for (const vendor of vendors) { + this.nisqAnalyzerService + .getCompilers(vendor) + .subscribe((availableCompilers) => { + for (const availableCompiler of availableCompilers) { + setOfAllAvailableCompilers.add(availableCompiler); + } + }); + setOfAllAvailableCompilers.forEach((compiler) => + this.selectedCompilers.push(compiler) + ); + this.compilers.clear(); + for (const compiler of this.selectedCompilers) { + this.compilers.push(new FormControl(compiler)); + } + } + } + + setIbmqEnabled(enabled: boolean): void { + this.ibmqEnabled = enabled; + if (enabled) { + this.selectedVendors.push('ibmq'); + this.setCompilerOptions(['ibmq']); + } else { + this.selectedVendors = this.selectedVendors.filter( + (item) => item !== 'ibmq' + ); + } + } + + setIonqEnabled(enabled: boolean): void { + this.ionqEnabled = enabled; + if (enabled) { + this.selectedVendors.push('ionq'); + this.setCompilerOptions(['ionq']); + } else { + this.selectedVendors = this.selectedVendors.filter( + (item) => item !== 'ionq' + ); + } } setWaitingTimeEnabled(enabled: boolean): void { @@ -269,8 +279,7 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent interface DialogData { title: string; - vendor: string; - token: string; + vendors: string[]; selectedCompilers: string[]; predictionAlgorithm: string; metaOptimizer: string; @@ -278,4 +287,7 @@ interface DialogData { maxNumberOfCompiledCircuits: number; stableExecutionResults: boolean; shortWaitingTime: boolean; + ibmqToken: string; + awsToken: string; + awsSecretToken: string; } diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html index 722a7853..f5760ea7 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html @@ -1,9 +1,17 @@

{{data.title}}

- - Token - + + IBMQ Token + + + + AWS Access Key + + + + AWS Secret Key +
diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts index 57d31574..f5d51303 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts @@ -25,16 +25,28 @@ export class ImplementationTokenDialogComponent implements OnInit { public dialog: MatDialog ) {} - get token(): AbstractControl | null { - return this.implementationExecutionForm.get('token'); + get ibmqToken(): AbstractControl | null { + return this.implementationExecutionForm.get('ibmqToken'); + } + + get awsToken(): AbstractControl | null { + return this.implementationExecutionForm.get('awsToken'); + } + + get awsSecretToken(): AbstractControl | null { + return this.implementationExecutionForm.get('awsSecretToken'); } ngOnInit(): void { this.implementationExecutionForm = new FormGroup({ - token: new FormControl(this.data.token), + ibmqToken: new FormControl(this.data.ibmqToken), + awsToken: new FormControl(this.data.awsToken), + awsSecretToken: new FormControl(this.data.awsSecretToken), }); this.dialogRef.beforeClosed().subscribe(() => { - this.data.token = this.token.value; + this.data.ibmqToken = this.ibmqToken.value; + this.data.awsToken = this.awsToken.value; + this.data.awsSecretToken = this.awsSecretToken.value; }); } @@ -45,5 +57,8 @@ export class ImplementationTokenDialogComponent implements OnInit { export interface DialogData { title: string; - token: string; + vendor: string; + ibmqToken: string; + awsToken: string; + awsSecretToken: string; } diff --git a/src/app/components/algorithms/implementation-view/implementation-execution/implementation-execution.component.ts b/src/app/components/algorithms/implementation-view/implementation-execution/implementation-execution.component.ts index ec828579..63664f45 100644 --- a/src/app/components/algorithms/implementation-view/implementation-execution/implementation-execution.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-execution/implementation-execution.component.ts @@ -160,7 +160,11 @@ export class ImplementationExecutionComponent implements OnInit { this.results = undefined; this.executedCompilationResult = analysisResult; this.nisqAnalyzerService - .executeCompilationResult(analysisResult.id, token) + .executeCompilationResult( + analysisResult.id, + analysisResult.provider, + token + ) .subscribe( (results) => { this.utilService.callSnackBar( @@ -288,15 +292,10 @@ export class ImplementationExecutionComponent implements OnInit { circuitName: this.nisqImpl.name, qpuName: dialogResult.qpu, circuitUrl: this.nisqImpl.fileLocation, - token, + tokens: new Map([dialogResult.vendor, token]), }; this.rootService .selectCompilerForFile1$Json({ - providerName: dialogResult.vendor, - circuitLanguage: this.nisqImpl.language, - circuitName: this.nisqImpl.name, - qpuName: dialogResult.qpu, - token, body: compilerSelectionDto, }) .subscribe( diff --git a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts index 3372be00..fa0a508a 100644 --- a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts @@ -28,6 +28,7 @@ import { EntityModelMcdaJob, EntityModelMcdaSensitivityAnalysisJob, EntityModelMcdaWeightLearningJob, + ExecuteAnalysisResultRequestDto, ExecutionResultDto, QpuSelectionDto, QpuSelectionResultDto, @@ -214,18 +215,17 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent this.analyzerJob = undefined; this.jobReady = false; refreshToken = this.planqkService.getRefreshToken(); - const providerTokens = {}; - if (dialogResult.token) { - providerTokens[dialogResult.vendor] = dialogResult.token; - } else { - providerTokens[dialogResult.vendor] = ' '; - } const qpuSelectionDto: QpuSelectionDto = { - allowedProviders: [dialogResult.vendor], + allowedProviders: dialogResult.vendors, circuitLanguage: this.nisqImpl.language, circuitUrl: this.nisqImpl.fileLocation, - tokens: providerTokens, + tokens: this.setVendorTokens( + dialogResult.vendors, + dialogResult.ibmqToken, + dialogResult.awsToken, + dialogResult.awsSecretToken + ), refreshToken, compilers: dialogResult.selectedCompilers, circuitName: this.nisqImpl.name, @@ -239,10 +239,6 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent }; this.nisqAnalyzerRootService .selectQpuForCircuitFile1$Json({ - circuitLanguage: this.nisqImpl.language, - circuitName: this.nisqImpl.name, - allowedProviders: [dialogResult.vendor], - tokens: providerTokens, body: qpuSelectionDto, }) .subscribe((job) => { @@ -307,21 +303,30 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent } execute(analysisResult: QpuSelectionResultDto): void { - let token = ' '; this.utilService .createDialog(ImplementationTokenDialogComponent, { title: 'Enter the token for the Vendor : ' + analysisResult.provider, + vendor: analysisResult.provider, }) .afterClosed() .subscribe((dialogResult) => { - if (dialogResult.token) { - token = dialogResult.token; - } this.loadingResults[analysisResult.id] = true; this.results = undefined; this.executedAnalyseResult = analysisResult; + const executeBodyDto: ExecuteAnalysisResultRequestDto = { + tokens: this.setVendorTokens( + [analysisResult.provider], + dialogResult.ibmqToken, + dialogResult.awsToken, + dialogResult.awsSecretToken + ), + }; + this.qpuSelectionService - .executeQpuSelectionResult({ resId: analysisResult.id, token }) + .executeQpuSelectionResult({ + resId: analysisResult.id, + body: executeBodyDto, + }) .subscribe( (results) => { if ( @@ -358,6 +363,28 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent }); } + setVendorTokens( + vendors: string[], + ibmqToken: string, + awsToken: string, + awsSecretToken: string + ): Map> { + const providerTokens: Map> = new Map(); + const rawTokens: Map = new Map(); + if (vendors.filter((vendor) => vendor === 'ibmq') != null) { + rawTokens.clear(); + rawTokens.set('ibmq', ibmqToken); + providerTokens.set('ibmq', rawTokens); + } + if (vendors.filter((vendor) => vendor === 'ionq') != null) { + rawTokens.clear(); + rawTokens.set('awsAccessKey', awsToken); + rawTokens.set('awsSecretKey', awsSecretToken); + providerTokens.set('ionq', rawTokens); + } + return providerTokens; + } + hasExecutionResult(analysisResult: QpuSelectionResultDto): void { this.qpuSelectionService .getQpuSelectionResult({ resId: analysisResult.id }) diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts index ba3730a3..739bc796 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts @@ -109,7 +109,7 @@ export class NisqAnalyzerComponent implements OnInit { >(); executeAnalysisResultRequestDto: ExecuteAnalysisResultRequestDto = { refreshToken: '', - token: '', + tokens: new Map>(), }; constructor( @@ -379,7 +379,11 @@ export class NisqAnalyzerComponent implements OnInit { if (dialogResult.token) { token = dialogResult.token; } - this.executeAnalysisResultRequestDto.token = token; + const rawTokens: Map = new Map(); + rawTokens.set(analysisResult.provider, token); + const tokens: Map> = new Map(); + tokens.set(analysisResult.provider, rawTokens); + this.executeAnalysisResultRequestDto.tokens = tokens; this.nisqAnalyzerService .execute(analysisResult.id, this.executeAnalysisResultRequestDto) .subscribe( diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.service.ts b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.service.ts index 7698f2b6..ce1c4b87 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.service.ts +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.service.ts @@ -57,11 +57,14 @@ export class NisqAnalyzerService { executeCompilationResult( resId: string, - token: string + token: string, + vendor: string ): Observable { + const tokens = new Map(); + tokens.set(vendor, token); return this.compilerAnalysisResult.executeCompilationResult({ resId, - token, + tokens, }); } From b7aef61f208f4a2bfc7a5e1cf6c18e20f66ce7ea Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Mon, 27 Nov 2023 09:50:28 +0100 Subject: [PATCH 02/23] set multiple tokens for qpu selection --- .../execute-analysis-result-request-dto.ts | 2 +- .../api-nisq/models/qpu-selection-dto.ts | 2 +- ...analyzer-qpu-selection-dialog.component.ts | 27 +++++----- ...n-nisq-analyzer-qpu-selection.component.ts | 52 ++++++++++++------- 4 files changed, 48 insertions(+), 35 deletions(-) diff --git a/generated/api-nisq/models/execute-analysis-result-request-dto.ts b/generated/api-nisq/models/execute-analysis-result-request-dto.ts index 779d30d4..deb39439 100644 --- a/generated/api-nisq/models/execute-analysis-result-request-dto.ts +++ b/generated/api-nisq/models/execute-analysis-result-request-dto.ts @@ -1,5 +1,5 @@ /* tslint:disable */ export type ExecuteAnalysisResultRequestDto = { refreshToken?: string; - tokens?: Map>; + tokens?: {}; }; diff --git a/generated/api-nisq/models/qpu-selection-dto.ts b/generated/api-nisq/models/qpu-selection-dto.ts index 207927ea..877400b5 100644 --- a/generated/api-nisq/models/qpu-selection-dto.ts +++ b/generated/api-nisq/models/qpu-selection-dto.ts @@ -4,7 +4,7 @@ export type QpuSelectionDto = { circuitLanguage?: string; circuitUrl?: string; qasmCode?: string; - tokens?: Map>; + tokens?: {}; refreshToken?: string; circuitName?: string; preciseResultsPreference?: boolean; diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts index 3237ee19..11e34066 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts @@ -32,7 +32,7 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent selectedCompilers: string[] = []; ibmqEnabled = true; - ionqEnabled = true; + ionqEnabled = false; shortWaitingTimeEnabled = false; stableExecutionResultsEnabled = false; predictionAlgorithmInDialog = 'extra_trees_regressor'; @@ -136,11 +136,11 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent ), }); - this.selectedVendors = ['ibmq', 'ionq']; + this.selectedVendors = ['ibmq']; for (const vendor of this.selectedVendors) { this.vendors.push(new FormControl(vendor)); } - this.setCompilerOptions(this.vendors.value); + this.setCompilerOptions(this.selectedVendors); this.predictionAlgorithm.setValue('extra_trees_regressor'); this.metaOptimizer.setValue('ada_boost_regressor'); this.maxNumberOfCompiledCircuits.setValue(5); @@ -167,7 +167,7 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent } updateCompilerSelection(compilerName: string, allowed: boolean): void { - if (allowed) { + if (allowed && !this.selectedCompilers.includes(compilerName)) { this.selectedCompilers.push(compilerName); } else { this.selectedCompilers = this.selectedCompilers.filter( @@ -192,7 +192,6 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent } setCompilerOptions(vendors: string[]): void { - debugger; const setOfAllAvailableCompilers = new Set(); for (const vendor of vendors) { this.nisqAnalyzerService @@ -201,14 +200,16 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent for (const availableCompiler of availableCompilers) { setOfAllAvailableCompilers.add(availableCompiler); } + setOfAllAvailableCompilers.forEach((compiler) => { + if (!this.selectedCompilers.includes(compiler)) { + this.selectedCompilers.push(compiler); + } + }); + this.compilers.clear(); + for (const compiler of setOfAllAvailableCompilers) { + this.compilers.push(new FormControl(compiler)); + } }); - setOfAllAvailableCompilers.forEach((compiler) => - this.selectedCompilers.push(compiler) - ); - this.compilers.clear(); - for (const compiler of this.selectedCompilers) { - this.compilers.push(new FormControl(compiler)); - } } } @@ -216,7 +217,6 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent this.ibmqEnabled = enabled; if (enabled) { this.selectedVendors.push('ibmq'); - this.setCompilerOptions(['ibmq']); } else { this.selectedVendors = this.selectedVendors.filter( (item) => item !== 'ibmq' @@ -228,7 +228,6 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent this.ionqEnabled = enabled; if (enabled) { this.selectedVendors.push('ionq'); - this.setCompilerOptions(['ionq']); } else { this.selectedVendors = this.selectedVendors.filter( (item) => item !== 'ionq' diff --git a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts index fa0a508a..ff3d4e29 100644 --- a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts @@ -215,17 +215,20 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent this.analyzerJob = undefined; this.jobReady = false; refreshToken = this.planqkService.getRefreshToken(); + const tokensToDeliver = this.setVendorTokens( + dialogResult.vendors, + dialogResult.ibmqToken, + dialogResult.awsToken, + dialogResult.awsSecretToken + ); + + debugger; const qpuSelectionDto: QpuSelectionDto = { allowedProviders: dialogResult.vendors, circuitLanguage: this.nisqImpl.language, circuitUrl: this.nisqImpl.fileLocation, - tokens: this.setVendorTokens( - dialogResult.vendors, - dialogResult.ibmqToken, - dialogResult.awsToken, - dialogResult.awsSecretToken - ), + tokens: tokensToDeliver, refreshToken, compilers: dialogResult.selectedCompilers, circuitName: this.nisqImpl.name, @@ -368,21 +371,32 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent ibmqToken: string, awsToken: string, awsSecretToken: string - ): Map> { - const providerTokens: Map> = new Map(); - const rawTokens: Map = new Map(); - if (vendors.filter((vendor) => vendor === 'ibmq') != null) { - rawTokens.clear(); - rawTokens.set('ibmq', ibmqToken); - providerTokens.set('ibmq', rawTokens); + ): {} { + const providerTokens = new Map>(); + const rawTokensIbmq = new Map(); + const rawTokensIonq = new Map(); + debugger; + if (vendors.includes('ibmq')) { + rawTokensIbmq.set('ibmq', ibmqToken); + providerTokens.set('ibmq', rawTokensIbmq); } - if (vendors.filter((vendor) => vendor === 'ionq') != null) { - rawTokens.clear(); - rawTokens.set('awsAccessKey', awsToken); - rawTokens.set('awsSecretKey', awsSecretToken); - providerTokens.set('ionq', rawTokens); + if (vendors.includes('ionq')) { + rawTokensIonq.set('awsAccessKey', awsToken); + rawTokensIonq.set('awsSecretKey', awsSecretToken); + providerTokens.set('ionq', rawTokensIonq); } - return providerTokens; + + debugger; + // converting such that it can be delivered via HTTP + const convMap: { [props: string]: { [props: string]: string } } = {}; + providerTokens.forEach((val: Map, key: string) => { + const innerConvMap: { [props: string]: string } = {}; + val.forEach((subVal: string, subkey: string) => { + innerConvMap[subkey] = subVal; + }); + convMap[key] = innerConvMap; + }); + return convMap; } hasExecutionResult(analysisResult: QpuSelectionResultDto): void { From b38d4c492972af3df947d24586a7429f90bab221 Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Mon, 27 Nov 2023 09:50:46 +0100 Subject: [PATCH 03/23] remove debugger --- .../implementation-nisq-analyzer-qpu-selection.component.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts index ff3d4e29..fd39d101 100644 --- a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts @@ -222,8 +222,6 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent dialogResult.awsSecretToken ); - debugger; - const qpuSelectionDto: QpuSelectionDto = { allowedProviders: dialogResult.vendors, circuitLanguage: this.nisqImpl.language, @@ -375,7 +373,6 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent const providerTokens = new Map>(); const rawTokensIbmq = new Map(); const rawTokensIonq = new Map(); - debugger; if (vendors.includes('ibmq')) { rawTokensIbmq.set('ibmq', ibmqToken); providerTokens.set('ibmq', rawTokensIbmq); @@ -386,7 +383,6 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent providerTokens.set('ionq', rawTokensIonq); } - debugger; // converting such that it can be delivered via HTTP const convMap: { [props: string]: { [props: string]: string } } = {}; providerTokens.forEach((val: Map, key: string) => { From 49bdb3529945538c433421a89c1e584a70722345 Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Mon, 27 Nov 2023 11:02:42 +0100 Subject: [PATCH 04/23] check if execution dialog was canceled or not --- ...n-nisq-analyzer-qpu-selection.component.ts | 98 ++++++++++--------- 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts index fd39d101..926a66bc 100644 --- a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts @@ -311,56 +311,59 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent }) .afterClosed() .subscribe((dialogResult) => { - this.loadingResults[analysisResult.id] = true; - this.results = undefined; - this.executedAnalyseResult = analysisResult; - const executeBodyDto: ExecuteAnalysisResultRequestDto = { - tokens: this.setVendorTokens( - [analysisResult.provider], - dialogResult.ibmqToken, - dialogResult.awsToken, - dialogResult.awsSecretToken - ), - }; + if (dialogResult) { + this.loadingResults[analysisResult.id] = true; + this.results = undefined; + this.executedAnalyseResult = analysisResult; + const executeBodyDto: ExecuteAnalysisResultRequestDto = { + tokens: this.setVendorTokens( + [analysisResult.provider], + dialogResult.ibmqToken, + dialogResult.awsToken, + dialogResult.awsSecretToken + ), + }; - this.qpuSelectionService - .executeQpuSelectionResult({ - resId: analysisResult.id, - body: executeBodyDto, - }) - .subscribe( - (results) => { - if ( - results.status === 'FAILED' || - results.status === 'FINISHED' - ) { - this.results = results; - } else { - interval(1000) - .pipe( - exhaustMap(() => - this.http.get( - results._links['self'].href + this.qpuSelectionService + .executeQpuSelectionResult({ + resId: analysisResult.id, + body: executeBodyDto, + }) + .subscribe( + (results) => { + if ( + results.status === 'FAILED' || + results.status === 'FINISHED' + ) { + this.results = results; + } else { + interval(1000) + .pipe( + exhaustMap(() => + this.http.get( + results._links['self'].href + ) + ), + first( + (value) => + value.status === 'FAILED' || + value.status === 'FINISHED' ) - ), - first( - (value) => - value.status === 'FAILED' || value.status === 'FINISHED' ) - ) - .subscribe((finalResult) => (this.results = finalResult)); + .subscribe((finalResult) => (this.results = finalResult)); + } + this.utilService.callSnackBar( + 'Successfully started execution "' + results.id + '".' + ); + this.hasExecutionResult(analysisResult); + }, + () => { + this.utilService.callSnackBar( + 'Error! Could not start execution.' + ); } - this.utilService.callSnackBar( - 'Successfully started execution "' + results.id + '".' - ); - this.hasExecutionResult(analysisResult); - }, - () => { - this.utilService.callSnackBar( - 'Error! Could not start execution.' - ); - } - ); + ); + } }); } @@ -736,6 +739,9 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent } showBackendQueueSize(analysisResult: QpuSelectionResultDto): void { + if (analysisResult.provider === 'ionq') { + this.queueLengths[analysisResult.qpu] = 0; + } this.nisqAnalyzerService .getIBMQBackendState(analysisResult.qpu) .subscribe((data) => { From 707110644ec25e614c7cc4c962664426d4ca2d02 Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Mon, 27 Nov 2023 13:34:33 +0100 Subject: [PATCH 05/23] receive queue size for ionq devices --- ...n-nisq-analyzer-qpu-selection.component.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts index 926a66bc..cb7de4c4 100644 --- a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts @@ -740,6 +740,29 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent showBackendQueueSize(analysisResult: QpuSelectionResultDto): void { if (analysisResult.provider === 'ionq') { + this.qprovService.getProviders().subscribe((providers) => { + for (const providerDto of providers._embedded.providerDtoes) { + if ( + providerDto.name.toLowerCase() === + analysisResult.provider.toLowerCase() + ) { + this.provider = providerDto; + break; + } + } + // search for QPU with given name from the given provider + this.qprovService + .getQpUs({ providerId: this.provider.id }) + .subscribe((qpuResult) => { + for (const qpuDto of qpuResult._embedded.qpuDtoes) { + if ( + qpuDto.name.toLowerCase() === analysisResult.qpu.toLowerCase() + ) { + this.queueLengths[analysisResult.qpu] = qpuDto.queueSize; + } + } + }); + }); this.queueLengths[analysisResult.qpu] = 0; } this.nisqAnalyzerService From 2077b9869a66bae792661e1d20ce133fa34ab04a Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Mon, 27 Nov 2023 13:50:52 +0100 Subject: [PATCH 06/23] fix queuesize presentation --- ...tation-nisq-analyzer-qpu-selection.component.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts index cb7de4c4..1b353c06 100644 --- a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts @@ -763,13 +763,15 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent } }); }); - this.queueLengths[analysisResult.qpu] = 0; + } else if (analysisResult.provider === 'ibmq') { + this.nisqAnalyzerService + .getIBMQBackendState(analysisResult.qpu) + .subscribe((data) => { + this.queueLengths[analysisResult.qpu] = data.lengthQueue; + }); + } else { + this.queueLengths[analysisResult.qpu] = null; } - this.nisqAnalyzerService - .getIBMQBackendState(analysisResult.qpu) - .subscribe((data) => { - this.queueLengths[analysisResult.qpu] = data.lengthQueue; - }); } checkIfQpuDataIsOutdated(analysisResult: QpuSelectionResultDto): void { From 3dafce0f7b6e1c13aa5fa7d74ef398abf4e08945 Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Fri, 1 Dec 2023 13:05:04 +0100 Subject: [PATCH 07/23] fix execution tab collection of IonQ devices --- .../implementation-execution-dialog.component.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.ts b/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.ts index c287be74..4b5a9eb6 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.ts +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-execution-dialog/implementation-execution-dialog.component.ts @@ -12,6 +12,7 @@ import { } from '@angular/forms'; import { ProviderService } from 'api-qprov/services/provider.service'; import { EntityModelProviderDto } from 'api-qprov/models/entity-model-provider-dto'; +import { CollectionModelEntityModelProviderDto } from 'api-qprov/models/collection-model-entity-model-provider-dto'; @Component({ selector: 'app-implementation-execution-dialog', @@ -79,10 +80,10 @@ export class ImplementationExecutionDialogComponent implements OnInit { onVendorChanged(value: string): void { this.qpuArray = []; - this.isIbmqSelected = true; - if (value === 'IBMQ') { + if (value === 'IBMQ' || value === 'IonQ') { + this.isIbmqSelected = true; this.providerService.getProviders().subscribe((result) => { - this.getProviderDtoByName(result); + this.getProviderDtoByName(result, value); if (!this.provider) { console.error('Provider with given name not found!'); this.ready = true; @@ -104,13 +105,16 @@ export class ImplementationExecutionDialogComponent implements OnInit { } } - getProviderDtoByName(result): void { + getProviderDtoByName( + result: CollectionModelEntityModelProviderDto, + provider: string + ): void { if (result === null) { console.error('Error while loading provider!'); return; } for (const providerDto of result._embedded.providerDtoes) { - if (providerDto.name.toLowerCase() === 'ibmq') { + if (providerDto.name.toLowerCase() === provider.toLowerCase()) { this.provider = providerDto; return; } @@ -122,6 +126,7 @@ export class ImplementationExecutionDialogComponent implements OnInit { console.error('Error while loading QPUs!'); return; } + this.qpuArray = []; for (const qpuDto of result._embedded.qpuDtoes) { this.qpuArray.push(qpuDto.name); } From a0d3cae681e38f930679af5146a4176609259dcf Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Fri, 1 Dec 2023 13:36:00 +0100 Subject: [PATCH 08/23] add ionq besides aws as provider --- ...alyzer-qpu-selection-dialog.component.html | 13 ++++++++++-- ...analyzer-qpu-selection-dialog.component.ts | 20 ++++++++++++++++++- ...implementation-token-dialog.component.html | 6 +++++- .../implementation-token-dialog.component.ts | 7 +++++++ ...n-nisq-analyzer-qpu-selection.component.ts | 13 ++++++++++-- 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html index 998db590..33d1fd65 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.html @@ -4,19 +4,28 @@

{{data.title}}

Select vendor:
IBMQ -
+ IBMQ Token +
IonQ + IonQ Token + + +
+ AWS Braket + + AWS Access Key - + AWS Secret Key diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts index 11e34066..4ff64679 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-dialog/implementation-nisq-analyzer-qpu-selection-dialog.component.ts @@ -6,7 +6,6 @@ import { FormGroup, Validators, } from '@angular/forms'; -import { EntityModelProviderDto } from 'api-qprov/models/entity-model-provider-dto'; import { MAT_DIALOG_DATA, MatDialog, @@ -33,6 +32,7 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent ibmqEnabled = true; ionqEnabled = false; + awsEnabled = false; shortWaitingTimeEnabled = false; stableExecutionResultsEnabled = false; predictionAlgorithmInDialog = 'extra_trees_regressor'; @@ -61,6 +61,10 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent return this.qpuSelectionFrom.get('ibmqToken'); } + get ionqToken(): AbstractControl | null { + return this.qpuSelectionFrom.get('ionqToken'); + } + get awsToken(): AbstractControl | null { return this.qpuSelectionFrom.get('awsToken'); } @@ -101,6 +105,7 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent this.qpuSelectionFrom = new FormGroup({ vendors: new FormArray([]), ibmqToken: new FormControl(this.data.ibmqToken), + ionqToken: new FormControl(this.data.ionqToken), awsToken: new FormControl(this.data.awsToken), awsSecretToken: new FormControl(this.data.awsSecretToken), compilers: new FormArray([]), @@ -157,6 +162,7 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent this.data.shortWaitingTime = this.shortWaitingTimeEnabled; this.data.stableExecutionResults = this.stableExecutionResultsEnabled; this.data.ibmqToken = this.ibmqToken.value; + this.data.ionqToken = this.ionqToken.value; this.data.awsToken = this.awsToken.value; this.data.awsSecretToken = this.awsSecretToken.value; }); @@ -235,6 +241,17 @@ export class ImplementationNisqAnalyzerQpuSelectionDialogComponent } } + setAwsEnabled(enabled: boolean): void { + this.awsEnabled = enabled; + if (enabled) { + this.selectedVendors.push('aws'); + } else { + this.selectedVendors = this.selectedVendors.filter( + (item) => item !== 'aws' + ); + } + } + setWaitingTimeEnabled(enabled: boolean): void { this.shortWaitingTimeEnabled = enabled; } @@ -287,6 +304,7 @@ interface DialogData { stableExecutionResults: boolean; shortWaitingTime: boolean; ibmqToken: string; + ionqToken: string; awsToken: string; awsSecretToken: string; } diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html index f5760ea7..f60675a7 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.html @@ -6,10 +6,14 @@

{{data.title}}

+ IonQ Token + + + AWS Access Key - + AWS Secret Key diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts index f5d51303..ea141bc3 100644 --- a/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component.ts @@ -29,6 +29,10 @@ export class ImplementationTokenDialogComponent implements OnInit { return this.implementationExecutionForm.get('ibmqToken'); } + get ionqToken(): AbstractControl | null { + return this.implementationExecutionForm.get('ionqToken'); + } + get awsToken(): AbstractControl | null { return this.implementationExecutionForm.get('awsToken'); } @@ -40,11 +44,13 @@ export class ImplementationTokenDialogComponent implements OnInit { ngOnInit(): void { this.implementationExecutionForm = new FormGroup({ ibmqToken: new FormControl(this.data.ibmqToken), + ionqToken: new FormControl(this.data.ionqToken), awsToken: new FormControl(this.data.awsToken), awsSecretToken: new FormControl(this.data.awsSecretToken), }); this.dialogRef.beforeClosed().subscribe(() => { this.data.ibmqToken = this.ibmqToken.value; + this.data.ionqToken = this.ionqToken.value; this.data.awsToken = this.awsToken.value; this.data.awsSecretToken = this.awsSecretToken.value; }); @@ -59,6 +65,7 @@ export interface DialogData { title: string; vendor: string; ibmqToken: string; + ionqToken: string; awsToken: string; awsSecretToken: string; } diff --git a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts index 1b353c06..30f9b263 100644 --- a/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts +++ b/src/app/components/algorithms/implementation-view/implementation-nisq-analyzer-qpu-selection/implementation-nisq-analyzer-qpu-selection.component.ts @@ -218,6 +218,7 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent const tokensToDeliver = this.setVendorTokens( dialogResult.vendors, dialogResult.ibmqToken, + dialogResult.ionqToken, dialogResult.awsToken, dialogResult.awsSecretToken ); @@ -319,6 +320,7 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent tokens: this.setVendorTokens( [analysisResult.provider], dialogResult.ibmqToken, + dialogResult.ionqToken, dialogResult.awsToken, dialogResult.awsSecretToken ), @@ -370,21 +372,28 @@ export class ImplementationNisqAnalyzerQpuSelectionComponent setVendorTokens( vendors: string[], ibmqToken: string, + ionqToken: string, awsToken: string, awsSecretToken: string ): {} { const providerTokens = new Map>(); const rawTokensIbmq = new Map(); const rawTokensIonq = new Map(); + const rawTokensAws = new Map(); + if (vendors.includes('ibmq')) { rawTokensIbmq.set('ibmq', ibmqToken); providerTokens.set('ibmq', rawTokensIbmq); } if (vendors.includes('ionq')) { - rawTokensIonq.set('awsAccessKey', awsToken); - rawTokensIonq.set('awsSecretKey', awsSecretToken); + rawTokensIonq.set('ionq', ionqToken); providerTokens.set('ionq', rawTokensIonq); } + if (vendors.includes('aws')) { + rawTokensAws.set('awsAccessKey', awsToken); + rawTokensAws.set('awsSecretKey', awsSecretToken); + providerTokens.set('aws', rawTokensAws); + } // converting such that it can be delivered via HTTP const convMap: { [props: string]: { [props: string]: string } } = {}; From 75fd1563ee52819edb562701a91fc41017a6a738 Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Thu, 11 Jul 2024 11:54:23 +0200 Subject: [PATCH 09/23] initial commit for advanced nisq analyzer selection --- .../api-nisq/models/analysis-result-dto.ts | 26 +------ .../execute-analysis-result-request-dto.ts | 1 + .../api-nisq/models/execution-result-dto.ts | 1 + .../api-nisq/models/implementation-dto.ts | 1 - .../api-nisq/models/selection-request-dto.ts | 11 +++ .../services/analysis-result.service.ts | 69 +----------------- .../impl-selection-criteria.component.html | 19 +---- .../impl-selection-criteria.component.ts | 10 --- ...analyzer-qpu-selection-dialog.component.ts | 16 ++-- .../nisq-analyzer/nisq-analyzer.component.ts | 28 +++---- .../nisq-analyzer/nisq-analyzer.service.ts | 4 +- .../navigation/navigation.component.html | 3 +- src/assets/Quantil.png | Bin 0 -> 991637 bytes 13 files changed, 48 insertions(+), 141 deletions(-) create mode 100644 src/assets/Quantil.png diff --git a/generated/api-nisq/models/analysis-result-dto.ts b/generated/api-nisq/models/analysis-result-dto.ts index 05254017..923fc431 100644 --- a/generated/api-nisq/models/analysis-result-dto.ts +++ b/generated/api-nisq/models/analysis-result-dto.ts @@ -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; }; diff --git a/generated/api-nisq/models/execute-analysis-result-request-dto.ts b/generated/api-nisq/models/execute-analysis-result-request-dto.ts index deb39439..fc43bbc8 100644 --- a/generated/api-nisq/models/execute-analysis-result-request-dto.ts +++ b/generated/api-nisq/models/execute-analysis-result-request-dto.ts @@ -2,4 +2,5 @@ export type ExecuteAnalysisResultRequestDto = { refreshToken?: string; tokens?: {}; + correlationId?: string; }; diff --git a/generated/api-nisq/models/execution-result-dto.ts b/generated/api-nisq/models/execution-result-dto.ts index 3ed468e0..1bbe63fa 100644 --- a/generated/api-nisq/models/execution-result-dto.ts +++ b/generated/api-nisq/models/execution-result-dto.ts @@ -7,5 +7,6 @@ export type ExecutionResultDto = { result?: string; shots?: number; histogramIntersectionValue?: number; + resultLocation?: string; _links?: Links; }; diff --git a/generated/api-nisq/models/implementation-dto.ts b/generated/api-nisq/models/implementation-dto.ts index d35f69c1..86c61947 100644 --- a/generated/api-nisq/models/implementation-dto.ts +++ b/generated/api-nisq/models/implementation-dto.ts @@ -7,7 +7,6 @@ export type ImplementationDto = { implementedAlgorithm?: string; algorithmName?: string; language?: string; - selectionRule?: string; sdk?: string; fileLocation?: string; inputParameters?: ParameterListDto; diff --git a/generated/api-nisq/models/selection-request-dto.ts b/generated/api-nisq/models/selection-request-dto.ts index e024f242..3b593d89 100644 --- a/generated/api-nisq/models/selection-request-dto.ts +++ b/generated/api-nisq/models/selection-request-dto.ts @@ -1,6 +1,17 @@ /* tslint:disable */ export type SelectionRequestDto = { parameters?: {}; + allowedProviders?: Array; + compilers?: Array; + preciseResultsPreference?: boolean; + shortWaitingTimesPreference?: boolean; + queueImportanceRatio?: number; + maxNumberOfCompiledCircuits?: number; + predictionAlgorithm?: string; + metaOptimizer?: string; + tokens?: {}; algorithmId?: string; refreshToken?: string; + mcdaMethodName?: string; + mcdaWeightLearningMethod?: string; }; diff --git a/generated/api-nisq/services/analysis-result.service.ts b/generated/api-nisq/services/analysis-result.service.ts index 099d1be2..fd7b636f 100644 --- a/generated/api-nisq/services/analysis-result.service.ts +++ b/generated/api-nisq/services/analysis-result.service.ts @@ -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', @@ -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. @@ -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. @@ -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> { - 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) => { - return r as StrictHttpResponse; - }) - ); - } - - /** - * 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 { - return this.executeAnalysisResult$Response(params).pipe( - map( - (r: StrictHttpResponse) => - r.body as ExecutionResultDto - ) - ); - } } diff --git a/src/app/components/algorithms/impl-selection-criteria/impl-selection-criteria.component.html b/src/app/components/algorithms/impl-selection-criteria/impl-selection-criteria.component.html index 8967e17b..b5c37fef 100644 --- a/src/app/components/algorithms/impl-selection-criteria/impl-selection-criteria.component.html +++ b/src/app/components/algorithms/impl-selection-criteria/impl-selection-criteria.component.html @@ -37,7 +37,7 @@

Required information for the NISQ Analyzer

- +
Input Parameters [choices]="[ { value: 'Integer', label: 'Integer' }, { value: 'Float', label: 'Float' }, - { value: 'String', label: 'String' } + { value: 'String', label: 'String' }, + { value: 'FloatArray', label: 'FloatArray' } ]" (onChange)="param.type = $event" > @@ -132,20 +133,6 @@

Input Parameters

-
-

Prolog Rules

-
- -
-
- -
-
-
- -
-
+
+ + + + + + +
+
+

Analysis Job from {{ analyzerJob.time }}

+ Input: +
-

Analysis Job from {{ analyzerJob.time }}, Input: {{ resParam.key }} = {{ resParam.value }}

-
- Check if QPU data is up-to-date - -
-
+ {{ resParam.key }} = {{ resParam.value }} +
+

+
+ Check if QPU data is up-to-date + +
+
+
+ No suitable QPUs found! +
+ + + + + + + + + + + + + + + + + + - -
- No suitable implementation and/or QPU found! -
- -
-

Implementation: {{ result.key.name }}

-
+ Rank + + {{ getRankOfResult(element) }} + + Score + + {{ getScoreOfResult(element) }} + + Implementation + + {{ element.circuitName }} + + Backend Name + + {{ element.qpu }} +

OUTDATED

+
- - - - + + + + - - - - + + + + - - - - + + + + + + + + + - - - - - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - - - -
- Backend Name - - {{ element.qpu }} -

OUTDATED

-
+ Provider + + {{ element.provider }} + - Provider - - {{ element.provider }} - + SDK + + {{ element.compiler }} + - SDK - - {{ element.compiler }} - + Width + + {{ element.analyzedWidth }} + + Depth + + {{ element.analyzedDepth }} + - Width - - {{ element.analyzedWidth }} - - Depth - - {{ element.analyzedDepth }} - + Multi-Qubit Gate Depth + + {{ element.analyzedMultiQubitGateDepth }} + - Multi-Qubit Gate Depth - - {{ element.analyzedMultiQubitGateDepth }} - + Total Number of Operations + + {{ element.analyzedTotalNumberOfOperations }} + - Total Number of Operations - - {{ element.analyzedTotalNumberOfOperations }} - + Number of Single-Qubit Gates + + {{ element.analyzedNumberOfSingleQubitGates }} + - Number of Single-Qubit Gates - - {{ element.analyzedNumberOfSingleQubitGates }} - + Number of Multi-Qubit Gates + + {{ element.analyzedNumberOfMultiQubitGates }} + - Number of Multi-Qubit Gates - - {{ element.analyzedNumberOfMultiQubitGates }} - + Number of Measurement Operations + + {{ element.analyzedNumberOfMeasurementOperations }} + - Number of Measurement Operations - - {{ element.analyzedNumberOfMeasurementOperations }} - + Avg. Single-Qubit Gate Error + + {{ element.avgSingleQubitGateError }} + - Avg. Single-Qubit Gate Error - - {{ element.avgSingleQubitGateError }} - + Avg. Multi-Qubit Gate Error + + {{ element.avgMultiQubitGateError }} + - Avg. Multi-Qubit Gate Error - - {{ element.avgMultiQubitGateError }} - + Avg. Single-Qubit Gate Time (ns) + + {{ element.avgSingleQubitGateTime }} + - Avg. Single-Qubit Gate Time (ns) - - {{ element.avgSingleQubitGateTime }} - + Avg. Multi-Qubit Gate Time (ns) + + {{ element.avgMultiQubitGateTime }} + - Avg. Multi-Qubit Gate Time (ns) - - {{ element.avgMultiQubitGateTime }} - + Avg. Readout Error + + {{ element.avgReadoutError }} + - Avg. Readout Error - - {{ element.avgReadoutError }} - + Avg. T1 (ns) + + {{ element.t1 === 0 ? '-' : element.t1 }} + - Avg. T1 (ns) - - {{ element.t1 === 0 ? '-' : element.t1 }} - + Avg. T2 (ns) + + {{ element.t2 === 0 ? '-' : element.t2 }} + - Avg. T2 (ns) - - {{ element.t2 === 0 ? '-' : element.t2 }} - + Queue Size + + {{ queueLengths[element.qpu] }} + - Queue Size - - {{ queueLengths[element.qpu] }} - + Est. Histogram Intersection Value + + {{ element.estimatedHistogramIntersectionValue === null ? '-' : element.estimatedHistogramIntersectionValue }} + Execution Result -
- -
- - - - - - -
Execution Result +
+ +
+ + + + + + +
-
- -
-
Status: {{ expandedElementMap.get(element).status }}
-
Result:
- {{ expandedElementMap.get(element).result || 'n/a' }} -
+ + +
+
+ +
+
+ Status: {{ expandedElementMap.get(element).status }}
+
Number of + shots: {{ expandedElementMap.get(element).shots === 0 ? + '-' : expandedElementMap.get(element).shots}} +
+
Histogram intersection value: + + {{expandedElementMap.get(element).histogramIntersectionValue === 0 ? + '-' : expandedElementMap.get(element).histogramIntersectionValue}} + +
+
Result: + {{ expandedElementMap.get(element).result || 'n/a' }}
+
+
+
+
-
- - + + + + + + - \ No newline at end of file + diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts index 0e4283bc..4654d77a 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts @@ -21,6 +21,10 @@ import { AnalysisJobDto, ExecuteAnalysisResultRequestDto, QpuSelectionResultDto, + EntityModelMcdaSensitivityAnalysisJob, + EntityModelMcdaWeightLearningJob, + CriterionValue, + EntityModelMcdaJob, } from 'api-nisq/models'; import { AnalysisResultService } from 'api-nisq/services/analysis-result.service'; import { ImplementationService } from 'api-nisq/services/implementation.service'; @@ -28,10 +32,23 @@ import { SdksService } from 'api-nisq/services/sdks.service'; import { MatTableDataSource } from '@angular/material/table'; import { ProviderService } from 'generated/api-qprov/services'; import { MatSort } from '@angular/material/sort'; +import { QpuSelectionResultService } from 'api-nisq/services/qpu-selection-result.service'; +import { XmcdaCriteriaService } from 'api-nisq/services/xmcda-criteria.service'; import { UtilService } from '../../../util/util.service'; import { AddNewAnalysisDialogComponent } from '../dialogs/add-new-analysis-dialog.component'; import { ImplementationTokenDialogComponent } from '../implementation-view/dialogs/implementation-token-dialog/implementation-token-dialog.component'; import { PlanqkPlatformLoginService } from '../../../services/planqk-platform-login.service'; +// eslint-disable-next-line max-len +import { + Criterion, + DialogData, + ImplementationNisqAnalyzerQpuSelectionPrioritizationDialogComponent, +} from '../implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-prioritization-dialog/implementation-nisq-analyzer-qpu-selection-prioritization-dialog.component'; +// eslint-disable-next-line max-len +import { ImplementationNisqAnalyzerQpuSelectionLearnedWeightsDialogComponent } from '../implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-learned-weights-dialog/implementation-nisq-analyzer-qpu-selection-learned-weights-dialog.component'; +import { ChangePageGuard } from '../../../services/deactivation-guard'; +// eslint-disable-next-line max-len +import { ImplementationNisqAnalyzerQpuSelectionSensitivityAnalysisDialogComponent } from '../implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-sensitivity-analysis-dialog/implementation-nisq-analyzer-qpu-selection-sensitivity-analysis-dialog.component'; import { NisqAnalyzerService } from './nisq-analyzer.service'; @Component({ @@ -51,7 +68,8 @@ import { NisqAnalyzerService } from './nisq-analyzer.service'; }) export class NisqAnalyzerComponent implements OnInit { @Input() algo: AlgorithmDto; - @ViewChild('nisqAnalysisResultSort') public nisqAnalysisResultSort: MatSort; + @Input() guard: ChangePageGuard; + @ViewChild(MatSort) sort: MatSort; // 1) Selection params: ParameterDto[]; @@ -61,11 +79,14 @@ export class NisqAnalyzerComponent implements OnInit { // 2) Analyze phase analyzeColumns = [ + 'implementationName', + 'rank', + 'score', 'qpu', 'provider', 'compiler', - 'width', - 'depth', + 'analyzedWidth', + 'analyzedDepth', 'analyzedMultiQubitGateDepth', 'analyzedTotalNumberOfOperations', 'analyzedNumberOfSingleQubitGates', @@ -79,6 +100,7 @@ export class NisqAnalyzerComponent implements OnInit { 't1', 't2', 'lengthQueue', + 'estimatedHistogramIntersectionValue', 'execution', ]; analyzerResults: AnalysisResultDto[] = []; @@ -93,13 +115,32 @@ export class NisqAnalyzerComponent implements OnInit { queueLengths = new Map(); executionResultsAvailable = new Map(); loadingResults = new Map(); - groupedResultsMap = new Map< - NISQImplementationDto, - MatTableDataSource - >(); qpuDataIsUpToDate = new Map(); qpuCounter = 0; qpuCheckFinished = false; + loadingLearnWeights = false; + learnedWeightsReady = false; + loadingMCDAJob = false; + usedMcdaMethod: string; + usedLearningMethod: string; + dataSource = new MatTableDataSource(this.allQpuSelectionResults); + rankings: Ranking[] = []; + usedShortWaitingTime: boolean; + usedStableExecutionResults: boolean; + queueImportanceRatio: number; + sensitivityAnalysisJob: EntityModelMcdaSensitivityAnalysisJob; + sensitivityAnalysisJobReady = false; + pollingSensitivityAnalysisJobReadyData: Subscription; + sensitivityAnalysisJobSuccessful = false; + waitUntilSensitivityAnalysisIsFinished = false; + sensitivityAnalysisPlot: string; + bordaCountEnabled: boolean; + pollingWeightLearningJobData: Subscription; + weightLearningJob: EntityModelMcdaWeightLearningJob; + learningJobReady: boolean; + prioritizationJobReady = false; + prioritizationJob: EntityModelMcdaJob; + mcdaJobSuccessful = false; // 3) Execution resultBackendColumns = ['backendName', 'width', 'depth']; @@ -123,7 +164,9 @@ export class NisqAnalyzerComponent implements OnInit { private implementationService: ImplementationService, private sdkService: SdksService, private qprovService: ProviderService, - private planqkService: PlanqkPlatformLoginService + private planqkService: PlanqkPlatformLoginService, + private qpuSelectionService: QpuSelectionResultService, + private mcdaService: XmcdaCriteriaService ) {} ngOnInit(): void { @@ -152,11 +195,7 @@ export class NisqAnalyzerComponent implements OnInit { } ngAfterViewInit(): void { - for (const entry of this.groupedResultsMap.entries()) { - const value = entry[1]; - value.sort = this.nisqAnalysisResultSort; - this.groupedResultsMap.set(entry[0], value); - } + this.dataSource.sort = this.sort; } changeSort(active: string, direction: 'asc' | 'desc' | ''): void { @@ -167,29 +206,26 @@ export class NisqAnalyzerComponent implements OnInit { } } - onMatSortChange(active: string, direction: 'asc' | 'desc' | ''): void { - for (const entry of this.groupedResultsMap.entries()) { - const value = entry[1]; - this.nisqAnalysisResultSort.active = active; - this.nisqAnalysisResultSort.direction = direction; - value.sort = this.nisqAnalysisResultSort; - value.sortingDataAccessor = (item, property): string | number => { - switch (property) { - case 'lengthQueue': - return this.queueLengths[item.qpu]; - default: { - if (property === 'width') { - property = 'analyzedWidth'; - } - if (property === 'depth') { - property = 'analyzedDepth'; - } - return item[property]; - } - } - }; - this.groupedResultsMap.set(entry[0], value); - } + onMatSortChange(): void { + this.dataSource.sort = this.sort; + this.dataSource.sortingDataAccessor = (item, property): string | number => { + switch (property) { + case 'rank': + const rankObject = this.rankings.find( + (value) => value.id === item.id + ); + return rankObject.rank; + case 'score': + const scoreObject = this.rankings.find( + (value) => value.id === item.id + ); + return scoreObject.score; + case 'lengthQueue': + return this.queueLengths[item.qpu]; + default: + return item[property]; + } + }; } formatParameters(analysisJob: AnalysisJobDto): string { @@ -280,6 +316,24 @@ export class NisqAnalyzerComponent implements OnInit { if (this.jobReady) { this.ngOnInit(); this.analyzerResults = jobResult.analysisResultList; + this.analyzerResults.forEach((analysisResult) => { + this.qpuSelectionService + .getQpuSelectionJob({ + resId: analysisResult.qpuSelectionJobId, + }) + .subscribe((qpuSelectionJob) => { + this.allQpuSelectionResults = this.allQpuSelectionResults.concat( + qpuSelectionJob.qpuSelectionResultList + ); + this.dataSource = new MatTableDataSource( + this.allQpuSelectionResults + ); + this.pollAnalysisJobData( + jobResult.initialMcdaMethod, + jobResult.initialMcdaJob + ); + }); + }); this.pollingAnalysisJobData.unsubscribe(); } }, @@ -299,9 +353,21 @@ export class NisqAnalyzerComponent implements OnInit { this.jobReady = jobResult.ready; this.analyzerJob = jobResult; this.analyzerResults = jobResult.analysisResultList; - this.groupResultsByImplementation(this.analyzerResults); - for (const analysisResult of this.analyzerResults) { + this.analyzerResults.forEach((analysisResult) => { + this.qpuSelectionService + .getQpuSelectionJob({ resId: analysisResult.qpuSelectionJobId }) + .subscribe((qpuSelectionJob) => { + this.allQpuSelectionResults = this.allQpuSelectionResults.concat( + qpuSelectionJob.qpuSelectionResultList + ); + this.dataSource = new MatTableDataSource( + this.allQpuSelectionResults + ); + }); + }); + for (const analysisResult of this.allQpuSelectionResults) { this.showBackendQueueSize(analysisResult); + setInterval(() => this.showBackendQueueSize(analysisResult), 300000); this.hasExecutionResult(analysisResult); this.checkIfQpuDataIsOutdated(analysisResult); } @@ -309,35 +375,6 @@ export class NisqAnalyzerComponent implements OnInit { return true; } - groupResultsByImplementation(analysisResults: AnalysisResultDto[]): void { - const results: GroupedResults[] = []; - const resultMap = new Map< - NISQImplementationDto, - MatTableDataSource - >(); - for (const analysisResult of analysisResults) { - const group = results.find( - (res) => res.implementation.id === analysisResult.implementation.id - ); - if (group) { - group.results.push(analysisResult); - } else { - results.push({ - implementation: analysisResult.implementation, - results: [analysisResult], - }); - } - } - for (const res of results) { - if (!resultMap.has(res.implementation)) { - const temp = new MatTableDataSource(res.results); - // temp.sort = this.nisqAnalysisResultSort; - resultMap.set(res.implementation, temp); - } - } - this.groupedResultsMap = resultMap; - } - checkIfQpuDataIsOutdated(analysisResult: QpuSelectionResultDto): void { let provider = null; this.qprovService.getProviders().subscribe((providers) => { @@ -381,6 +418,74 @@ export class NisqAnalyzerComponent implements OnInit { }); } + goToLink(url: string): void { + window.open(url, '_blank'); + } + + analyzeSensitivity(): void { + this.utilService + .createDialog( + ImplementationNisqAnalyzerQpuSelectionSensitivityAnalysisDialogComponent, + { + title: 'Analyze Sensitivity of Ranking', + } + ) + .afterClosed() + .subscribe((dialogResult) => { + if (dialogResult) { + this.mcdaService + .analyzeSensitivityOfCompiledCircuitsOfJob({ + methodName: this.usedMcdaMethod, + jobId: this.analyzerJob.id, + stepSize: dialogResult.stepSize, + upperBound: dialogResult.upperBound, + lowerBound: dialogResult.lowerBound, + useBordaCount: this.bordaCountEnabled, + queueImportanceRatio: this.queueImportanceRatio, + }) + .subscribe( + (job) => { + this.waitUntilSensitivityAnalysisIsFinished = true; + this.sensitivityAnalysisJobSuccessful = false; + this.sensitivityAnalysisJob = job; + this.sensitivityAnalysisJobReady = job.ready; + this.utilService.callSnackBar( + 'Successfully created sensitivity analysis job "' + + job.id + + '".' + ); + + this.pollingSensitivityAnalysisJobReadyData = interval(2000) + .pipe( + startWith(0), + switchMap(() => + this.mcdaService.getSensitivityAnalysisJob({ + methodName: this.usedMcdaMethod, + jobId: job.id, + }) + ) + ) + .subscribe((jobResult) => { + this.sensitivityAnalysisJob = jobResult; + this.sensitivityAnalysisJobReady = jobResult.ready; + if (jobResult.state === 'FINISHED') { + this.sensitivityAnalysisJobSuccessful = true; + this.waitUntilSensitivityAnalysisIsFinished = false; + this.sensitivityAnalysisPlot = jobResult.plotFileLocation; + this.pollingSensitivityAnalysisJobReadyData.unsubscribe(); + } + }); + }, + () => { + this.utilService.callSnackBar( + 'Error! Could not start sensitivity analysis.' + ); + } + ); + } + }); + } + execute(analysisResult: QpuSelectionResultDto): void { let token = ' '; this.utilService @@ -521,6 +626,239 @@ export class NisqAnalyzerComponent implements OnInit { }); return convMap; } + + getRankOfResult(result: QpuSelectionResultDto): number | string { + const rankingResult = this.rankings.find((value) => value.id === result.id); + if (rankingResult) { + return rankingResult.rank; + } else { + return '-'; + } + } + + getScoreOfResult(result: QpuSelectionResultDto): number | string { + const rankingResult = this.rankings.find((value) => value.id === result.id); + if ( + rankingResult && + this.prioritizationJob.method !== 'electre-III' && + !this.bordaCountEnabled + ) { + return rankingResult.score; + } else { + return '-'; + } + } + + prioritize(): void { + this.utilService + .createDialog( + ImplementationNisqAnalyzerQpuSelectionPrioritizationDialogComponent, + { + title: 'Prioritize Analysis Results', + } + ) + .afterClosed() + .subscribe((dialogResult) => { + if (dialogResult) { + this.learnedWeightsReady = false; + this.usedMcdaMethod = dialogResult.mcdaMethod; + this.usedLearningMethod = dialogResult.weightLearningMethod; + this.usedShortWaitingTime = dialogResult.shortWaitingTime; + this.usedStableExecutionResults = dialogResult.stableExecutionResults; + this.queueImportanceRatio = dialogResult.queueImportanceRatio; + if (dialogResult.stableExecutionResults) { + this.loadingLearnWeights = true; + this.mcdaService + .learnWeightsForCompiledCircuitsOfJob({ + methodName: this.usedMcdaMethod, + weightLearningMethod: this.usedLearningMethod, + }) + .subscribe((job) => { + this.weightLearningJob = job; + this.learningJobReady = job.ready; + this.utilService.callSnackBar( + 'Successfully started to learn weights.' + ); + this.pollingWeightLearningJobData = interval(2000) + .pipe( + startWith(0), + switchMap(() => + this.mcdaService.getWeightLearningJob({ + methodName: this.usedMcdaMethod, + weightLearningMethod: this.usedLearningMethod, + jobId: this.weightLearningJob.id, + }) + ) + ) + .subscribe((jobResult) => { + this.weightLearningJob = jobResult; + this.learningJobReady = jobResult.ready; + if (jobResult.state === 'FINISHED') { + this.pollingWeightLearningJobData.unsubscribe(); + this.loadingLearnWeights = false; + this.learnedWeightsReady = true; + this.utilService.callSnackBar( + 'Learned weights are ready.' + ); + } else if (jobResult.state === 'FAILED') { + this.pollingWeightLearningJobData.unsubscribe(); + this.loadingLearnWeights = false; + this.learnedWeightsReady = false; + this.utilService.callSnackBar( + 'Error! Could not learn weights.' + ); + } + }); + }); + } else { + this.executePrioritization(dialogResult); + } + } + }); + } + + seeLearnedWeights(): void { + this.utilService + .createDialog( + ImplementationNisqAnalyzerQpuSelectionLearnedWeightsDialogComponent, + { + title: 'Learned Weights', + mcdaMethod: this.usedMcdaMethod, + } + ) + .afterClosed() + .subscribe((dialogResult) => { + if (dialogResult) { + this.learnedWeightsReady = false; + this.executePrioritization(dialogResult); + } + }); + } + + executePrioritization(dialogResult): void { + this.loadingMCDAJob = true; + this.prioritizationJobReady = false; + let totalSum = 0; + let criteria = dialogResult.criteriaAndValues; + this.bordaCountEnabled = !!( + this.usedStableExecutionResults && this.usedShortWaitingTime + ); + if (this.usedStableExecutionResults) { + criteria = dialogResult.criteriaAndValues; + } else { + // calculate SMART with new assigned points + dialogResult.criteriaAndValues.forEach((obj) => { + totalSum += obj.points; + }); + dialogResult.criteriaAndValues.forEach((obj) => { + if (obj.points !== 0) { + obj.weight = obj.points / totalSum; + } else { + obj.weight = 0; + } + }); + } + let numberOfCriterion = 0; + criteria.forEach((obj) => { + const criterionValue: CriterionValue = { + description: { title: 'points', subTitle: obj.points.toString() }, + criterionID: obj.id, + valueOrValues: [{ real: obj.weight }], + mcdaMethod: dialogResult.mcdaMethod, + }; + this.mcdaService + .updateCriterionValue({ + methodName: dialogResult.mcdaMethod, + criterionId: obj.id, + body: criterionValue, + }) + .subscribe( + () => { + numberOfCriterion++; + if (numberOfCriterion === criteria.length) { + this.mcdaService + .prioritizeCompiledCircuitsOfJob({ + methodName: dialogResult.mcdaMethod, + jobId: this.analyzerJob.id, + useBordaCount: this.bordaCountEnabled, + queueImportanceRatio: this.queueImportanceRatio, + }) + .subscribe((job) => { + this.rankings = []; + this.prioritizationJob = job; + this.prioritizationJobReady = job.ready; + this.mcdaJobSuccessful = false; + + this.utilService.callSnackBar( + 'Successfully created prioritization job "' + job.id + '".' + ); + this.pollAnalysisJobData( + dialogResult.mcdaMethod, + this.prioritizationJob.id + ); + }); + } + }, + () => { + this.loadingMCDAJob = false; + this.utilService.callSnackBar( + 'Error! Could not set weight for criteria "' + + obj.name + + '". Please try again.' + ); + } + ); + }); + } + + pollAnalysisJobData(mcdaMethod: string, prioritizationJobId: string): void { + this.pollingAnalysisJobData = interval(2000) + .pipe( + startWith(0), + switchMap(() => + this.mcdaService.getPrioritizationJob({ + methodName: mcdaMethod, + jobId: prioritizationJobId, + }) + ) + ) + .subscribe( + (jobResult) => { + this.prioritizationJob = jobResult; + this.prioritizationJobReady = jobResult.ready; + if (this.prioritizationJobReady) { + this.loadingMCDAJob = false; + jobResult.rankedResults.forEach((rankedResult) => { + this.rankings.push({ + id: rankedResult.resultId, + rank: rankedResult.position, + score: rankedResult.score, + }); + }); + this.allQpuSelectionResults.sort((a, b) => { + const objA = this.rankings.find((value) => value.id === a.id); + const objB = this.rankings.find((value) => value.id === b.id); + if (objA.rank < objB.rank) { + return -1; + } else { + return 1; + } + }); + this.dataSource = new MatTableDataSource( + this.allQpuSelectionResults + ); + this.mcdaJobSuccessful = true; + this.pollingAnalysisJobData.unsubscribe(); + } + }, + () => { + this.loadingMCDAJob = false; + this.utilService.callSnackBar( + 'Error! Could not create prioritization job.' + ); + } + ); + } } interface QiskitBackendState { @@ -531,7 +869,8 @@ interface QiskitBackendState { backend_version: string; } -export interface GroupedResults { - implementation: NISQImplementationDto; - results: AnalysisResultDto[]; +interface Ranking { + id: string; + rank: number; + score: number; } diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.module.ts b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.module.ts index fb9715db..ca5f2170 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.module.ts +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.module.ts @@ -9,6 +9,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatTableModule } from '@angular/material/table'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; import { GenericsModule } from '../../generics/generics.module'; import { NisqAnalyzerComponent } from './nisq-analyzer.component'; import { NisqAnalyzerService } from './nisq-analyzer.service'; @@ -28,6 +29,7 @@ import { NisqAnalyzerService } from './nisq-analyzer.service'; MatProgressSpinnerModule, MatCardModule, GenericsModule, + MatIconModule, ], exports: [NisqAnalyzerComponent], providers: [NisqAnalyzerService], From 817d4d666eea6b34552516b6f39ffd076e8ab8cf Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Tue, 6 Aug 2024 22:59:56 +0200 Subject: [PATCH 16/23] get queuesize and check up to date --- .../nisq-analyzer.component.html | 4 -- .../nisq-analyzer/nisq-analyzer.component.ts | 69 +++++++++++-------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html index d80f17a4..ef623ea6 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html @@ -143,10 +143,6 @@

Analysis Job from {{ analyzerJob.time }}

{{ resParam.key }} = {{ resParam.value }}

-
- Check if QPU data is up-to-date - -
{ this.qpuSelectionService .getQpuSelectionJob({ resId: analysisResult.qpuSelectionJobId }) @@ -363,19 +365,25 @@ export class NisqAnalyzerComponent implements OnInit { this.dataSource = new MatTableDataSource( this.allQpuSelectionResults ); + for (const analysisQpuSelectionResult of qpuSelectionJob.qpuSelectionResultList) { + this.queueLengths[analysisQpuSelectionResult.qpu] = + analysisQpuSelectionResult.queueSize; + this.hasExecutionResult(analysisQpuSelectionResult); + this.checkIfQpuDataIsOutdated( + analysisQpuSelectionResult, + qpuSelectionJob + ); + } }); }); - for (const analysisResult of this.allQpuSelectionResults) { - this.showBackendQueueSize(analysisResult); - setInterval(() => this.showBackendQueueSize(analysisResult), 300000); - this.hasExecutionResult(analysisResult); - this.checkIfQpuDataIsOutdated(analysisResult); - } }); return true; } - checkIfQpuDataIsOutdated(analysisResult: QpuSelectionResultDto): void { + checkIfQpuDataIsOutdated( + analysisResult: QpuSelectionResultDto, + qpuSelectionJob: QpuSelectionJobDto + ): void { let provider = null; this.qprovService.getProviders().subscribe((providers) => { for (const providerDto of providers._embedded.providerDtoes) { @@ -391,29 +399,26 @@ export class NisqAnalyzerComponent implements OnInit { this.qprovService .getQpUs({ providerId: provider.id }) .subscribe((qpuResult) => { - for (const qpuDto of qpuResult._embedded.qpuDtoes) { - if ( - qpuDto.name.toLowerCase() === analysisResult.qpu.toLowerCase() - ) { + if (analysisResult.qpu.toLowerCase() === 'aer_simulator') { + this.qpuDataIsUpToDate.set(analysisResult, true); + } else { + for (const qpuDto of qpuResult._embedded.qpuDtoes) { if ( - qpuDto.lastCalibrated === null || - Date.parse(analysisResult.time) >= - Date.parse(qpuDto.lastCalibrated) + qpuDto.name.toLowerCase() === analysisResult.qpu.toLowerCase() ) { - this.qpuDataIsUpToDate.set(analysisResult, true); - } else { - this.qpuDataIsUpToDate.set(analysisResult, false); + if ( + qpuDto.lastCalibrated === null || + Date.parse(analysisResult.time) >= + Date.parse(qpuDto.lastCalibrated) + ) { + this.qpuDataIsUpToDate.set(analysisResult, true); + } else { + this.qpuDataIsUpToDate.set(analysisResult, false); + } + break; } - break; } } - this.qpuCounter++; - if (this.qpuCounter === this.analyzerJob.analysisResultList.length) { - this.qpuCheckFinished = true; - this.qpuCounter = 0; - } else { - this.qpuCheckFinished = false; - } }); }); } @@ -582,11 +587,15 @@ export class NisqAnalyzerComponent implements OnInit { } showBackendQueueSize(analysisResult: QpuSelectionResultDto): void { - this.nisqAnalyzerService - .getIBMQBackendState(analysisResult.qpu) - .subscribe((data) => { - this.queueLengths[analysisResult.qpu] = data.lengthQueue; - }); + if (analysisResult.qpu !== 'aer_simluator') { + this.nisqAnalyzerService + .getIBMQBackendState(analysisResult.qpu) + .subscribe((data) => { + this.queueLengths[analysisResult.qpu] = data.lengthQueue; + }); + } else { + this.queueLengths[analysisResult.qpu] = analysisResult.queueSize; + } } setVendorTokens( From ccd14f886c2021c6cf91579f0e6569e2a4be629b Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Wed, 7 Aug 2024 09:56:15 +0200 Subject: [PATCH 17/23] fix request execution result --- .../nisq-analyzer/nisq-analyzer.component.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts index 056ba07f..b4cc5ebf 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts @@ -351,6 +351,7 @@ export class NisqAnalyzerComponent implements OnInit { showAnalysisResult(analysisJob: AnalysisJobDto): boolean { this.nisqAnalyzerService.getJob(analysisJob.id).subscribe((jobResult) => { + this.analyzerResults = []; this.jobReady = jobResult.ready; this.analyzerJob = jobResult; this.analyzerResults = jobResult.analysisResultList; @@ -377,6 +378,10 @@ export class NisqAnalyzerComponent implements OnInit { }); }); }); + this.pollAnalysisJobData( + analysisJob.initialMcdaMethod, + analysisJob.initialMcdaJob + ); return true; } @@ -549,8 +554,8 @@ export class NisqAnalyzerComponent implements OnInit { } hasExecutionResult(analysisResult: QpuSelectionResultDto): void { - this.analysisResultService - .getAnalysisResult({ resId: analysisResult.id }) + this.qpuSelectionService + .getQpuSelectionResult({ resId: analysisResult.id }) .subscribe((result) => { this.executionResultsAvailable[analysisResult.id] = !!Object.keys( result._links @@ -566,8 +571,8 @@ export class NisqAnalyzerComponent implements OnInit { this.expandedElementExecResult = undefined; return; } - this.analysisResultService - .getAnalysisResult({ resId: analysisResult.id }) + this.qpuSelectionService + .getQpuSelectionResult({ resId: analysisResult.id }) .subscribe((result) => { const key = Object.keys(result._links).find((k) => k.startsWith('execute-') @@ -575,8 +580,8 @@ export class NisqAnalyzerComponent implements OnInit { const href = result._links[key].href; this.http.get(href).subscribe((dto) => { this.expandedElement = analysisResult; - this.expandedElementExecResult = dto; this.expandedElementMap.set(analysisResult, dto); + this.expandedElementExecResult = dto; }); }); } From c925b021a278c4bef0eab08d20e0ba91e7e8abec Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Wed, 7 Aug 2024 10:04:14 +0200 Subject: [PATCH 18/23] fix execute --- .../nisq-analyzer/nisq-analyzer.component.ts | 95 ++++++++++--------- 1 file changed, 51 insertions(+), 44 deletions(-) diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts index b4cc5ebf..5ccf7ac5 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts @@ -497,59 +497,66 @@ export class NisqAnalyzerComponent implements OnInit { } execute(analysisResult: QpuSelectionResultDto): void { - let token = ' '; this.utilService .createDialog(ImplementationTokenDialogComponent, { title: 'Enter the token for the Vendor : ' + analysisResult.provider, + vendor: analysisResult.provider, }) .afterClosed() .subscribe((dialogResult) => { - this.loadingResults[analysisResult.id] = true; - this.results = undefined; - this.executedQpuSelectionResult = analysisResult; - if (dialogResult.token) { - token = dialogResult.token; - } - const rawTokens: Map = new Map(); - rawTokens.set(analysisResult.provider, token); - const tokens: Map> = new Map(); - tokens.set(analysisResult.provider, rawTokens); - this.executeAnalysisResultRequestDto.tokens = tokens; - this.nisqAnalyzerService - .execute(analysisResult.id, this.executeAnalysisResultRequestDto) - .subscribe( - (results) => { - if ( - results.status === 'FAILED' || - results.status === 'FINISHED' - ) { - this.results = results; - } else { - interval(1000) - .pipe( - exhaustMap(() => - this.http.get( - results._links['self'].href + if (dialogResult) { + this.loadingResults[analysisResult.id] = true; + this.results = undefined; + const executeBodyDto: ExecuteAnalysisResultRequestDto = { + tokens: this.setVendorTokens( + [analysisResult.provider], + dialogResult.ibmqToken, + dialogResult.ionqToken, + dialogResult.awsToken, + dialogResult.awsSecretToken + ), + }; + + this.qpuSelectionService + .executeQpuSelectionResult({ + resId: analysisResult.id, + body: executeBodyDto, + }) + .subscribe( + (results) => { + if ( + results.status === 'FAILED' || + results.status === 'FINISHED' + ) { + this.results = results; + } else { + interval(1000) + .pipe( + exhaustMap(() => + this.http.get( + results._links['self'].href + ) + ), + first( + (value) => + value.status === 'FAILED' || + value.status === 'FINISHED' ) - ), - first( - (value) => - value.status === 'FAILED' || value.status === 'FINISHED' ) - ) - .subscribe((finalResult) => (this.results = finalResult)); + .subscribe((finalResult) => (this.results = finalResult)); + } + this.utilService.callSnackBar( + 'Successfully started execution "' + results.id + '".' + ); + this.hasExecutionResult(analysisResult); + }, + () => { + this.utilService.callSnackBar( + 'Error! Could not start execution.' + ); } - this.utilService.callSnackBar( - 'Successfully started execution "' + results.id + '".' - ); - this.hasExecutionResult(analysisResult); - }, - () => { - this.utilService.callSnackBar( - 'Error! Could not start execution.' - ); - } - ); + ); + } }); } From bb3d323a0e2d83a14036249f20a83b127d22f293 Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Wed, 7 Aug 2024 10:24:34 +0200 Subject: [PATCH 19/23] stop infinity requests --- .../algorithms/nisq-analyzer/nisq-analyzer.component.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts index 5ccf7ac5..46e793d5 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.ts @@ -329,10 +329,6 @@ export class NisqAnalyzerComponent implements OnInit { this.dataSource = new MatTableDataSource( this.allQpuSelectionResults ); - this.pollAnalysisJobData( - jobResult.initialMcdaMethod, - jobResult.initialMcdaJob - ); }); }); this.pollingAnalysisJobData.unsubscribe(); From 6d03ed14f01060677af80d23b3875a2b5021cb99 Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Wed, 7 Aug 2024 10:47:38 +0200 Subject: [PATCH 20/23] show post processing results --- .../nisq-analyzer/nisq-analyzer.component.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html index ef623ea6..c11c5746 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html @@ -405,7 +405,17 @@

Analysis Job from {{ analyzerJob.time }}

Result: - {{ expandedElementMap.get(element).result || 'n/a' }}
+ {{ expandedElementMap.get(element).result || 'n/a' }} + + From 3ab308e55b2eaae866dd1973e2eb1c89ac13eb9f Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Wed, 7 Aug 2024 11:49:44 +0200 Subject: [PATCH 21/23] show used weights --- ...tion-initial-weights-dialog.component.html | 22 +++++ ...tion-initial-weights-dialog.component.scss | 0 ...ection-initial-weights-dialog.component.ts | 97 +++++++++++++++++++ .../implementation-view.module.ts | 2 + .../nisq-analyzer.component.html | 8 ++ .../nisq-analyzer/nisq-analyzer.component.ts | 12 +++ 6 files changed, 141 insertions(+) create mode 100644 src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.html create mode 100644 src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.scss create mode 100644 src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.ts diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.html b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.html new file mode 100644 index 00000000..5738b874 --- /dev/null +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.html @@ -0,0 +1,22 @@ +
+

Initially learned Weights

+
+
+

The learned weights are presented

+
+
+
+ {{ criterion.name }}: +
+ {{ criterion.weight }} +
+
+
+
+
+
+
+ +
+
diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.scss b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.ts b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.ts new file mode 100644 index 00000000..3e10df93 --- /dev/null +++ b/src/app/components/algorithms/implementation-view/dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.ts @@ -0,0 +1,97 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms'; +import { + MAT_DIALOG_DATA, + MatDialog, + MatDialogRef, +} from '@angular/material/dialog'; +import { XmcdaCriteriaService } from 'api-nisq/services/xmcda-criteria.service'; +// eslint-disable-next-line max-len +import { Criterion } from '../implementation-nisq-analyzer-qpu-selection-prioritization-dialog/implementation-nisq-analyzer-qpu-selection-prioritization-dialog.component'; + +@Component({ + selector: + 'app-implementation-nisq-analyzer-qpu-selection-initial-weights-dialog', + templateUrl: + './implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.html', + styleUrls: [ + './implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component.scss', + ], +}) +export class ImplementationNisqAnalyzerQpuSelectionInitialWeightsDialogComponent + implements OnInit { + weightLearningForm: FormGroup; + criteriaNamesAndValues: Criterion[] = []; + inputChanged = false; + + constructor( + public dialogRef: MatDialogRef< + ImplementationNisqAnalyzerQpuSelectionInitialWeightsDialogComponent + >, + @Inject(MAT_DIALOG_DATA) public data: DialogData, + public dialog: MatDialog, + private formBuilder: FormBuilder, + private mcdaService: XmcdaCriteriaService + ) {} + + get criteriaAndValues(): AbstractControl | null { + return this.weightLearningForm.get('criteriaAndValues'); + } + + ngOnInit(): void { + this.onMcdaMethodChanged(); + } + + onNoClick(): void { + this.dialogRef.close(); + } + + onMcdaMethodChanged(): void { + this.criteriaNamesAndValues = []; + this.mcdaService + .getCriterionForMethod({ methodName: this.data.mcdaMethod }) + .subscribe((criteriaList) => { + // then get for each criterion the name and value and store both in the map as value + criteriaList.mcdaCriterionList.forEach((criterion) => { + this.mcdaService + .getCriterionValue({ + methodName: this.data.mcdaMethod, + criterionId: criterion.id, + }) + .subscribe((criterionValueModel) => { + const value = criterionValueModel.valueOrValues.pop(); + if (value) { + const realValue = value['real']; + this.criteriaNamesAndValues.push({ + id: criterion.id, + name: criterion.name, + weight: realValue, + points: Math.round( + Number(criterionValueModel.description.subTitle) + ), + }); + } + this.weightLearningForm = this.formBuilder.group({ + criteriaAndValues: this.formBuilder.array( + this.criteriaNamesAndValues.map((c) => + this.formBuilder.group({ + [c.name]: [c.weight], + }) + ) + ), + }); + }); + }); + }); + } + + onChangeEvent(): void { + this.inputChanged = true; + } +} + +export interface DialogData { + title: string; + mcdaMethod: string; + criteriaAndValues: Criterion[]; +} diff --git a/src/app/components/algorithms/implementation-view/implementation-view.module.ts b/src/app/components/algorithms/implementation-view/implementation-view.module.ts index 574cf24b..989c2b13 100644 --- a/src/app/components/algorithms/implementation-view/implementation-view.module.ts +++ b/src/app/components/algorithms/implementation-view/implementation-view.module.ts @@ -46,6 +46,7 @@ import { ImplementationNisqAnalyzerQpuSelectionSensitivityAnalysisDialogComponen import { ImplementationTokenDialogComponent } from './dialogs/implementation-token-dialog/implementation-token-dialog.component'; // eslint-disable-next-line max-len import { ImplementationNisqAnalyzerQpuSelectionLearnedWeightsDialogComponent } from './dialogs/implementation-nisq-analyzer-qpu-selection-learned-weights-dialog/implementation-nisq-analyzer-qpu-selection-learned-weights-dialog.component'; +import { ImplementationNisqAnalyzerQpuSelectionInitialWeightsDialogComponent } from './dialogs/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog/implementation-nisq-analyzer-qpu-selection-initial-weights-dialog.component'; @NgModule({ declarations: [ @@ -61,6 +62,7 @@ import { ImplementationNisqAnalyzerQpuSelectionLearnedWeightsDialogComponent } f ImplementationNisqAnalyzerQpuSelectionSensitivityAnalysisDialogComponent, ImplementationTokenDialogComponent, ImplementationNisqAnalyzerQpuSelectionLearnedWeightsDialogComponent, + ImplementationNisqAnalyzerQpuSelectionInitialWeightsDialogComponent, ], imports: [ CommonModule, diff --git a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html index c11c5746..be121257 100644 --- a/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html +++ b/src/app/components/algorithms/nisq-analyzer/nisq-analyzer.component.html @@ -78,6 +78,14 @@

Analysis Jobs

> Back +