Skip to content

Commit

Permalink
Set --enable-circuits default to true (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
reza-j committed May 20, 2024
1 parent ffbe8ef commit 166b097
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/Conversion/QUIRToPulse/QUIRToPulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,15 @@ QUIRToPulsePass::convertCircuitToSequence(CallCircuitOp &callCircuitOp,
auto durOpConstantOp = callCircuitOp.getOperand(argNum)
.getDefiningOp<mlir::quir::ConstantOp>();
auto durOp = quir::getDuration(durOpConstantOp).get();
durValue = static_cast<uint>(durOp.getDuration().convertToDouble());
durValue =
static_cast<uint64_t>(durOp.getDuration().convertToDouble());
assert(durOp.getType().dyn_cast<DurationType>().getUnits() ==
TimeUnits::dt &&
"this pass only accepts durations with dt unit");
} else {
auto durOp = quir::getDuration(delayOp).get();
durValue = static_cast<uint>(durOp.getDuration().convertToDouble());
durValue =
static_cast<uint64_t>(durOp.getDuration().convertToDouble());
assert(durOp.getType().dyn_cast<DurationType>().getUnits() ==
TimeUnits::dt &&
"this pass only accepts durations with dt unit");
Expand Down
4 changes: 2 additions & 2 deletions lib/Dialect/Pulse/Transforms/Scheduling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void QuantumCircuitPulseSchedulingPass::scheduleAlap(
std::string const sequenceName = quantumCircuitSequenceOp.getSymName().str();
LLVM_DEBUG(llvm::dbgs() << "\nscheduling " << sequenceName << "\n");

int totalDurationOfQuantumCircuitNegative = 0;
int64_t totalDurationOfQuantumCircuitNegative = 0;
mixFrameToNextAvailabilityMap.clear();

// get the MLIR block of the quantum circuit
Expand Down Expand Up @@ -166,7 +166,7 @@ void QuantumCircuitPulseSchedulingPass::scheduleAlap(
}

// multiply by -1 so that quantum circuit duration becomes positive
const int totalDurationOfQuantumCircuit =
const int64_t totalDurationOfQuantumCircuit =
-totalDurationOfQuantumCircuitNegative;
LLVM_DEBUG(llvm::dbgs() << "\ttotal duration of quantum circuit "
<< totalDurationOfQuantumCircuit << "\n");
Expand Down

0 comments on commit 166b097

Please sign in to comment.