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 authored May 17, 2024
1 parent af612a2 commit 7de0bc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 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
2 changes: 1 addition & 1 deletion lib/Dialect/QUIR/Transforms/ExtractCircuits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ using namespace mlir::quir;
llvm::cl::opt<bool>
enableCircuits("enable-circuits",
llvm::cl::desc("enable extract quir circuits"),
llvm::cl::init(false));
llvm::cl::init(true));

static bool terminatesCircuit(Operation &op) {
return (op.hasTrait<::mlir::RegionBranchOpInterface::Trait>() ||
Expand Down

0 comments on commit 7de0bc3

Please sign in to comment.