Skip to content

Commit

Permalink
fix-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffry1829 committed Jun 6, 2024
1 parent fe0cb8f commit 8969fde
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions include/UniTensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4456,7 +4456,7 @@ namespace cytnx {
*/
UniTensor Contract(const std::vector<UniTensor> &TNs, const std::string &order,
const bool &optimal);
const bool &optimal);

/**
@deprecated
Expand Down Expand Up @@ -4496,7 +4496,7 @@ namespace cytnx {
*/
template <class... T>
UniTensor Contract(const UniTensor &in, const T &...args, const std::string &order,
const bool &optimal) {
const bool &optimal) {
std::vector<UniTensor> TNlist;
_resolve_CT(TNlist, in, args...);
return Contract(TNlist, order, optimal);
Expand Down
15 changes: 7 additions & 8 deletions pybind/unitensor_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1372,14 +1372,13 @@ void unitensor_binding(py::module &m) {
.def("get_qindices", [](UniTensor &self, const cytnx_uint64 &bidx){return self.get_qindices(bidx);});
; // end of object line

// m.def("Contract", Contract, py::arg("Tl"), py::arg("Tr"), py::arg("cacheL") = false,
// py::arg("cacheR") = false);
m.def("Contract",
[](const UniTensor &inL, const UniTensor &inR, const bool &cacheL,
const bool &cacheR)->UniTensor{
return Contract(inL, inR, cacheL, cacheR);
}, py::arg("Tl"), py::arg("Tr"), py::arg("cacheL") = false,
py::arg("cacheR") = false);
// m.def("Contract", Contract, py::arg("Tl"), py::arg("Tr"), py::arg("cacheL") = false,
// py::arg("cacheR") = false);
m.def(
"Contract",
[](const UniTensor &inL, const UniTensor &inR, const bool &cacheL,
const bool &cacheR) -> UniTensor { return Contract(inL, inR, cacheL, cacheR); },
py::arg("Tl"), py::arg("Tr"), py::arg("cacheL") = false, py::arg("cacheR") = false);
m.def(
"Contract",
[](const std::vector<UniTensor> &TNs, const std::string &order,
Expand Down
4 changes: 3 additions & 1 deletion src/UniTensor_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@ namespace cytnx {

void _resolve_CT(std::vector<UniTensor> &TNlist){};
UniTensor Contract(const std::vector<UniTensor> &TNs, const std::string &order = "",
const bool &optimal = true) {return Contracts(TNs, order, optimal);}
const bool &optimal = true) {
return Contracts(TNs, order, optimal);
}
UniTensor Contracts(const std::vector<UniTensor> &TNs, const std::string &order = "",
const bool &optimal = true) {
cytnx_error_msg(TNs.size() < 2, "[ERROR][Contracts] should have more than 2 TNs to contract.%s",
Expand Down
1 change: 0 additions & 1 deletion tests/gpu/Contract_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ TEST_F(ContractTest, gpu_Contract_denseUt_optimal_specified_order) {
EXPECT_TRUE(AreNearlyEqTensor(res.get_block().contiguous(), utdnAns.get_block(), 1e-12));
}


// Deprecated Contracts
TEST_F(ContractTest, gpu_Contracts_denseUt_optimal_order) {
UniTensor res = Contracts({utdnA, utdnB, utdnC}, "", true);
Expand Down

0 comments on commit 8969fde

Please sign in to comment.