Skip to content

Commit

Permalink
Consortial-State
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgDaniel committed Nov 13, 2023
1 parent 02455a1 commit 128c37d
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 139 deletions.
6 changes: 3 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"theme.scss"
],
"scripts": [
"node_modules/chart.js/dist/Chart.js",
"node_modules/hammerjs/hammer.min.js"
]
},
Expand Down Expand Up @@ -136,9 +135,10 @@
}
}
}
}},
}
},
"defaultProject": "qc-atlas-ui",
"cli": {
"analytics": false
}
}
}
86 changes: 40 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@angular/router": "~9.1.10",
"@fortawesome/fontawesome-free": "^5.13.1",
"@swimlane/ngx-graph": "^7.1.2",
"@types/chart.js": "^2.9.40",
"angular-bootstrap-md": "^9.3.1",
"animate.css": "^4.1.0",
"chart.js": "^4.4.0",
Expand Down Expand Up @@ -83,4 +84,4 @@
"tslint-plugin-prettier": "^2.3.0",
"typescript": "~3.8.3"
}
}
}

This file was deleted.

Empty file.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
</mat-tab>

<mat-tab label="Get Results">
<button id="Results" color="primary" (click)="getResults()">Get Results</button>
<!-- <button id="Results" color="primary" (click)="getResults()">Get Results</button> -->
<form (ngSubmit)="getResults(jobID)">
<input [(ngModel)]="jobID" name="jobID" placeholder=5 />
<button mat-flat-button color="primary" type="submit">Get Results</button>
</form>
<!-- <app-histogram-plot [counts]="{'0': 2007, '11': 1993}"></app-histogram-plot> -->
<div class="response-frame">
<div *ngIf="result">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { UtilService } from '../../../util/util.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import * as Chart from 'chart.js';

import { OnDemandComponent } from '../../on-demand-execution/ondemand.component';

@Component({
selector: 'qunicorn-service',
Expand All @@ -18,6 +15,7 @@ export class QunicornAppComponent implements OnInit {

userInput: string = '';
deploymentID: number = 3;
jobID: number = 3;

constructor(
private router: Router,
Expand Down Expand Up @@ -55,11 +53,17 @@ export class QunicornAppComponent implements OnInit {
.set('accept', 'application/json')
.set('Content-Type', 'application/json');

if (this.userInput = '') {
this.userInput = 'OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\ncreg meas[2];\nh q[0];\ncx q[0],q[1];\nbarrier q[0],q[1];\nmeasure q[0] -> meas[0];\nmeasure q[1] -> meas[1];\n';
}

console.log(this.userInput);

const requestBody = {
programs: [
{
// quantumCircuit: "OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\ncreg meas[2];\nh q[0];\ncx q[0],q[1];\nbarrier q[0],q[1];\nmeasure q[0] -> meas[0];\nmeasure q[1] -> meas[1];\n (Note: if you have qrisp/qiskit as your assembler language add 'circuit =' to the beginning of your quantumCircuit string)",
quantumCircuit: this.userInput,
quantumCircuit: "OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\ncreg meas[2];\nh q[0];\ncx q[0],q[1];\nbarrier q[0],q[1];\nmeasure q[0] -> meas[0];\nmeasure q[1] -> meas[1];\n",
//quantumCircuit: this.userInput,
assemblerLanguage: "QASM2"
}
],
Expand Down Expand Up @@ -96,7 +100,7 @@ export class QunicornAppComponent implements OnInit {
// parameters: [0],
token: "",
type: "RUNNER",
deploymentId: 3,
deploymentId: this.deploymentID,
};

this.http.post('http://localhost:5005/jobs/', requestBody, { headers: headers })
Expand All @@ -107,8 +111,11 @@ export class QunicornAppComponent implements OnInit {
});
}

getResults() {
this.http.get('http://localhost:5005/jobs/3/', { headers: { accept: 'application/json' } })
getResults(jobID: number) {

const url = `http://localhost:5005/jobs/${jobID}/`;

this.http.get(url, { headers: { accept: 'application/json' } })
.subscribe(
(data: any) => {
this.result = data;
Expand Down
7 changes: 2 additions & 5 deletions src/app/components/qunicorn-service/qunicorn.apps.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ import { QcAtlasUiFeatureToggleModule } from '../../directives/feature-toggle.mo
import { AlgorithmModule } from '../algorithms/algorithm.module';
import { NisqAnalyzerModule } from '../algorithms/nisq-analyzer/nisq-analyzer.module';
import { QunicornAppComponent } from './qunicorn-view/qunicorn-service.component';
import { OnDemandComponent } from '../on-demand-execution/ondemand.component';
import { HistogramPlotComponent } from './histogram-plot/histogram-plot.component';



@NgModule({
declarations: [
QunicornAppComponent,
HistogramPlotComponent,
],
imports: [
MatTabsModule,
Expand Down Expand Up @@ -68,6 +65,6 @@ import { HistogramPlotComponent } from './histogram-plot/histogram-plot.componen
NisqAnalyzerModule,
MatProgressBarModule,
],
exports: [QunicornAppComponent,HistogramPlotComponent],
exports: [QunicornAppComponent],
})
export class QunicornAppModule { }

0 comments on commit 128c37d

Please sign in to comment.