Skip to content

Commit

Permalink
Use constant for REM
Browse files Browse the repository at this point in the history
  • Loading branch information
wederbn committed May 15, 2024
1 parent aba0736 commit afd513b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import * as consts from "../../Constants";
import { useService } from "bpmn-js-properties-panel";
import { HiddenTextFieldEntry } from "../../../../editor/popup/HiddenFieldEntry";
import { READOUT_ERROR_MITIGATION_TASK } from "../../Constants";

/**
* All entries needed to display the different properties introduced through the QuantME task types. One entry represents one
Expand Down Expand Up @@ -740,7 +741,7 @@ export function ObjectiveFunctionEntry({ element }) {

const hidden = function () {
let taskType = element.businessObject.$type;
if (taskType === "quantme:ReadoutErrorMitigationTask") {
if (taskType === READOUT_ERROR_MITIGATION_TASK) {
let mitigationMethod = element.businessObject.mitigationMethod;
return !(mitigationMethod === "geneticBasedREM");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import {
getDefinitionsFromXml,
getRootProcess,
} from "../../../../editor/util/ModellingUtilities";
import { QUANTUM_CIRCUIT_EXECUTION_TASK } from "../../Constants";
import {
QUANTUM_CIRCUIT_EXECUTION_TASK,
READOUT_ERROR_MITIGATION_TASK,
} from "../../Constants";
/**
* Replace the given QuantumHardwareSelectionSubprocess by a native subprocess orchestrating the hardware selection
*/
Expand Down Expand Up @@ -74,8 +77,7 @@ export async function replaceCuttingSubprocess(
startEvent = element;
} else if (element.$type === QUANTUM_CIRCUIT_EXECUTION_TASK) {
if (
element.outgoing[0].targetRef.$type ===
"quantme:ReadoutErrorMitigationTask"
element.outgoing[0].targetRef.$type === READOUT_ERROR_MITIGATION_TASK
) {
combinePointers.push(element.outgoing[0].targetRef);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,7 @@ function getOptimizationCandidate(candidate) {
function containsQuantumCircuitExecutionTask(candidate) {
for (let i = 0; i < candidate.containedElements.length; i++) {
let element = candidate.containedElements[i];
if (
element.$type &&
element.$type === QUANTUM_CIRCUIT_EXECUTION_TASK
) {
if (element.$type && element.$type === QUANTUM_CIRCUIT_EXECUTION_TASK) {
return true;
}
}
Expand Down

0 comments on commit afd513b

Please sign in to comment.