GCC Code Coverage Report


Directory: ./
File: OpType/include/OpType/EdgeType.hpp
Date: 2022-10-15 05:10:18
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 4 4 100.0%
Branches: 7 16 43.8%
Decisions: 0 0 -%

Line Branch Decision Exec Source
1 // Copyright 2019-2022 Cambridge Quantum Computing
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #pragma once
16
17 #include <vector>
18
19 #include "Utils/Json.hpp"
20
21 namespace tket {
22
23 /** Type of a wire in a circuit or input to an op */
24 enum class EdgeType {
25 /**
26 * A wire carrying quantum information, corresponding to some allocated @ref
27 * Qubit. Since these are persistent, every node in the DAG (except for an
28 * input or output) has the same number of Quantum input and output wires.
29 */
30 Quantum,
31
32 /**
33 * A wire carrying classical information, corresponding to some allocated
34 * @ref Bit. Since these are persistent, every node in the DAG (except for
35 * an input or output) has the same number of Classical input and output
36 * wires.
37 */
38 Classical,
39
40 /**
41 * A wire carrying a bit of classical information from a classical output
42 * port of one op to a classical input port of another, not corresponding to
43 * any allocated @ref Bit.
44 */
45 Boolean
46 };
47
48
7/16
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 8 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
32 NLOHMANN_JSON_SERIALIZE_ENUM(
49 EdgeType, {
50 {EdgeType::Quantum, "Q"},
51 {EdgeType::Classical, "C"},
52 {EdgeType::Boolean, "B"},
53 });
54
55 typedef std::vector<EdgeType> op_signature_t;
56
57 } // namespace tket
58