16#ifndef __TENSOR_NODE_H_
17#define __TENSOR_NODE_H_ 1
36 const size_t qubitsNumber = gate.getQubitsNumber();
41 throw std::invalid_argument(
"The gate has more than 2 qubits. Decompose gates on a higher number "
42 "of qubits in gates on 1 and 2 qubits only.");
130 auto cloned = std::make_shared<TensorNode>();
147 auto cloned = std::make_shared<TensorNode>();
152 cloned->tensor = std::make_shared<Utils::Tensor<>>(
tensor->GetDims(),
true);
159 std::shared_ptr<TensorNode>
Clone()
const
161 auto cloned = std::make_shared<TensorNode>();
166 cloned->tensor = std::make_shared<Utils::Tensor<>>(*tensor);
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.