16#ifndef __TENSOR_NODE_H_
17#define __TENSOR_NODE_H_ 1
32 void SetGate(
const QC::Gates::QuantumGateWithOp<MatrixClass> &gate,
34 const size_t qubitsNumber = gate.getQubitsNumber();
39 throw std::invalid_argument(
40 "The gate has more than 2 qubits. Decompose gates on a higher number "
41 "of qubits in gates on 1 and 2 qubits only.");
114 auto cloned = std::make_shared<TensorNode>();
130 auto cloned = std::make_shared<TensorNode>();
135 cloned->tensor = std::make_shared<Utils::Tensor<>>(
tensor->GetDims(),
true);
142 std::shared_ptr<TensorNode>
Clone()
const {
143 auto cloned = std::make_shared<TensorNode>();
148 cloned->tensor = std::make_shared<Utils::Tensor<>>(*tensor);
159 std::vector<Types::qubit_t>
static std::shared_ptr< Utils::Tensor<> > CreateQubit0Tensor()
static std::shared_ptr< Utils::Tensor<> > CreateProjectionTensor(bool onZero=true)
static std::shared_ptr< Utils::Tensor<> > CreateQubit1Tensor()
static std::shared_ptr< Utils::Tensor<> > CreateTensorFromGate(const QC::Gates::QuantumGateWithOp< MatrixClass > &gate)
std::vector< Index > connectionsIndices
std::vector< Types::qubit_t > qubits
std::vector< Index > connections
std::shared_ptr< TensorNode > CloneWithoutTensorCopy() const
Eigen::MatrixXcd MatrixClass
std::shared_ptr< TensorNode > CloneWithADummyTensor() const
void SetQubit(Types::qubit_t q, bool zero=true)
size_t GetQubitsNumber() const
std::shared_ptr< Utils::Tensor<> > tensor
void SetProjector(Types::qubit_t q, bool zero=true)
static constexpr Index NotConnected
std::shared_ptr< TensorNode > Clone() const
bool contractsTheNeededQubit
void SetGate(const QC::Gates::QuantumGateWithOp< MatrixClass > &gate, Types::qubit_t q1, Types::qubit_t q2=0)
uint_fast64_t qubit_t
The type of a qubit.