Skip to content

Commit

Permalink
fix: Make compatibility argument optional, fix error type in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt-aws committed Jun 25, 2024
1 parent 88145c3 commit 2d57bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Quasar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ struct QasmVisitorError <: Exception
message::String
alternate_type::String
end
QasmVisitorError(message::String) = QasmVisitorError(message, "")
function Base.showerror(io::IO, err::QasmVisitorError)
print(io, "QasmVisitorError: ")
print(io, err.message)
Expand Down
4 changes: 2 additions & 2 deletions test/test_validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ using Test, Braket, BraketSimulator
@test_logs (:warn, "You are running a noise-free circuit on the density matrix simulator. Consider running this circuit on the state vector simulator: LocalSimulator(\"braket_sv_v2\") for a better user experience.") BraketSimulator._validate_ir_instructions_compatibility(sim, c, Val(:JAQCD))
sim = StateVectorSimulator(2, 0)
c = Circuit([(BitFlip(0.1), 0)])
@test_throws ErrorException BraketSimulator._validate_ir_instructions_compatibility(sim, c, Val(:OpenQASM))
@test_throws ErrorException BraketSimulator._validate_ir_instructions_compatibility(sim, c, Val(:JAQCD))
@test_throws ValidationError BraketSimulator._validate_ir_instructions_compatibility(sim, c, Val(:OpenQASM))
@test_throws ValidationError BraketSimulator._validate_ir_instructions_compatibility(sim, c, Val(:JAQCD))
end

0 comments on commit 2d57bc1

Please sign in to comment.