• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / Qiskit.jl / 19346414768

13 Nov 2025 09:29PM UTC coverage: 71.461% (-1.5%) from 72.966%
19346414768

push

github

web-flow
Add support for transpilation (#10)

* Add support for transpilation

Ref #3

* Fix test

Thank you to @jakelishman for pointing out what I had overlooked.

* TranspileResult object

* More progress on transpilation test

* Finish transpilation test

* Finish filling out error codes

36 of 66 new or added lines in 6 files covered. (54.55%)

313 of 438 relevant lines covered (71.46%)

140.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

12.12
/src/c_exit_code.jl
1
# This code is part of Qiskit.
2
#
3
# (C) Copyright IBM 2025.
4
#
5
# This code is licensed under the Apache License, Version 2.0. You may
6
# obtain a copy of this license in the LICENSE.txt file in the root directory
7
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8
#
9
# Any modifications or derivative works of this code must retain this
10
# copyright notice, and modified files need to carry a notice indicating
11
# that they have been altered from the originals.
12

13
@enum QkExitCode::UInt32 begin
14
    QkExitCode_Success = 0
15
    QkExitCode_CInputError = 100
16
    QkExitCode_NullPointerError = 101
17
    QkExitCode_AlignmentError = 102
18
    QkExitCode_IndexError = 103
19
    QkExitCode_DuplicateIndexError = 104
20
    QkExitCode_ArithmeticError = 200
21
    QkExitCode_MismatchedQubits = 201
22
    QkExitCode_ExpectedUnitary = 202
23
    QkExitCode_TargetError = 300
24
    QkExitCode_TargetInstAlreadyExists = 301
25
    QkExitCode_TargetQargMismatch = 302
26
    QkExitCode_TargetInvalidQargsKey = 303
27
    QkExitCode_TargetInvalidInstKey = 304
28
    QkExitCode_TranspilerError = 400
29
end
30

31
function check_exit_code(code::QkExitCode, error_string::Ptr{Cchar} = Ptr{Cchar}(C_NULL))::Nothing
368✔
32
    if error_string != C_NULL
441✔
33
        #println(unsafe_string(pointer(error_string)))
34
    end
35
    if code == QkExitCode_Success
222✔
36
        return
222✔
NEW
37
    elseif code == QkExitCode_CInputError
×
38
        throw(ErrorException("Error related to C data input."))
×
NEW
39
    elseif code == QkExitCode_NullPointerError
×
40
        throw(ErrorException("Unexpected null pointer."))
×
NEW
41
    elseif code == QkExitCode_AlignmentError
×
42
        throw(ErrorException("Pointer is not aligned to expected data."))
×
NEW
43
    elseif code == QkExitCode_IndexError
×
44
        throw(ErrorException("Index out of bounds."))
×
NEW
45
    elseif code == QkExitCode_DuplicateIndexError
×
NEW
46
        throw(ErrorException("Duplicate index."))
×
NEW
47
    elseif code == QkExitCode_ArithmeticError
×
48
        throw(ErrorException("Error related to arithmetic operations or similar."))
×
NEW
49
    elseif code == QkExitCode_MismatchedQubits
×
50
        throw(ErrorException("Mismatching number of qubits."))
×
NEW
51
    elseif code == QkExitCode_ExpectedUnitary
×
52
        throw(ErrorException("Matrix is not unitary."))
×
NEW
53
    elseif code == QkExitCode_TargetError
×
NEW
54
        throw(ErrorException("Target related error"))
×
NEW
55
    elseif code == QkExitCode_TargetInstAlreadyExists
×
NEW
56
        throw(ErrorException("Instruction already exists in the Target"))
×
NEW
57
    elseif code == QkExitCode_TargetQargMismatch
×
NEW
58
        throw(ErrorException("Properties with incorrect qargs was added"))
×
NEW
59
    elseif code == QkExitCode_TargetInvalidQargsKey
×
NEW
60
        throw(ErrorException("Trying to query into the target with non-existent qargs."))
×
NEW
61
    elseif code == QkExitCode_TargetInvalidInstKey
×
NEW
62
        throw(ErrorException("Querying an operation that doesn't exist in the Target."))
×
NEW
63
    elseif code == QkExitCode_TranspilerError
×
NEW
64
        throw(ErrorException("Transpilation failed."))
×
65
    else
NEW
66
        throw(ErrorException("Unrecognized error code from Qiskit: $code"))
×
67
    end
68
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc