Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/klay/circuit.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "node.h"
#include "hash_set8.hpp"

namespace klay {

class NodePtr {
public:
NodePtr(Node* ptr) : ptr(ptr) { }
Expand Down Expand Up @@ -216,3 +218,5 @@ class Circuit {
return NodePtr(add_node_level_compressed(node));
}
};

} // namespace klay
1 change: 1 addition & 0 deletions include/klay/indices.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace nb = nanobind;
using namespace nb::literals;
using namespace klay;

using Array = nb::ndarray<nb::numpy, long int, nb::shape<-1>>;
using Arrays = std::vector<Array>;
Expand Down
6 changes: 5 additions & 1 deletion include/klay/literal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <iostream>
using namespace std;

namespace klay {

typedef int Var;

/**
Expand Down Expand Up @@ -65,4 +67,6 @@ class Lit {

Lit Lit::fromInt(int i) {
return Lit(std::abs(i), i < 0);
}
}

} // namespace klay
3 changes: 3 additions & 0 deletions include/klay/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include "cassert"

namespace klay {

enum class NodeType {True, False, Or, And, Leaf};


Expand Down Expand Up @@ -127,3 +129,4 @@ struct NodeEqual {
};


} // namespace klay
2 changes: 2 additions & 0 deletions src/circuit.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "klay/circuit.h"
#include "cassert"

using namespace klay;

Node* Circuit::add_node(Node* node) {
if (layers.size() <= node->layer)
layers.resize(node->layer + 1);
Expand Down
2 changes: 2 additions & 0 deletions src/indices.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <klay/indices.h>
#include <klay/circuit.h>

using namespace klay;

void cleanup(void* data) noexcept {
delete[] static_cast<long int*>(data);
}
Expand Down
1 change: 1 addition & 0 deletions src/klay_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "klay/circuit.h"
#include "klay/indices.h"

using namespace klay;
namespace nb = nanobind;
using namespace nb::literals;

Expand Down
2 changes: 2 additions & 0 deletions src/node.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "klay/node.h"

using namespace klay;

/**
* Improve bit dispersion of a given hash value h.
*/
Expand Down