tket
Loading...
Searching...
No Matches
Gauss.hpp
Go to the documentation of this file.
1// Copyright Quantinuum
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
18
19namespace tket {
20
21class CXMaker {
22 public:
23 explicit CXMaker(unsigned qubits, bool reverse_cx_dirs = false)
24 : _circ(qubits), _reverse_cx_dirs(reverse_cx_dirs) {}
25 void row_add(unsigned r0, unsigned r1);
28};
29
31 public:
33 explicit DiagMatrix(const MatrixXb& matrix) : _matrix(matrix) {}
34 void row_add(unsigned r0, unsigned r1);
35 void col_add(unsigned c0, unsigned c1);
36 void gauss(CXMaker& cxmaker, unsigned blocksize = 6);
37 friend std::ostream& operator<<(std::ostream& out, const DiagMatrix& diam);
38 bool is_id() const;
39 bool is_id_until_columns(unsigned limit) const;
40 unsigned n_rows() const;
41 unsigned n_cols() const;
42
44};
45
46} // namespace tket
CXMaker(unsigned qubits, bool reverse_cx_dirs=false)
Definition Gauss.hpp:23
bool _reverse_cx_dirs
Definition Gauss.hpp:27
void row_add(unsigned r0, unsigned r1)
Definition Gauss.cpp:19
Circuit _circ
Definition Gauss.hpp:26
A circuit.
Definition Circuit.hpp:212
void row_add(unsigned r0, unsigned r1)
Definition Gauss.cpp:26
MatrixXb _matrix
Definition Gauss.hpp:43
bool is_id() const
Definition Gauss.cpp:47
friend std::ostream & operator<<(std::ostream &out, const DiagMatrix &diam)
Definition Gauss.cpp:77
unsigned n_cols() const
Definition Gauss.cpp:75
bool is_id_until_columns(unsigned limit) const
Definition Gauss.cpp:49
void gauss(CXMaker &cxmaker, unsigned blocksize=6)
Definition Gauss.cpp:38
DiagMatrix(const MatrixXb &matrix)
Definition Gauss.hpp:33
void col_add(unsigned c0, unsigned c1)
Definition Gauss.cpp:32
unsigned n_rows() const
Definition Gauss.cpp:73
Defines tket::DeviceCharacterisation, used in NoiseAwarePlacement and in commute_SQ_gates_through_SWA...
Definition Path.cpp:22
Eigen::Matrix< bool, Eigen::Dynamic, Eigen::Dynamic > MatrixXb