bsc-quantic / Tenet.jl

Composable Tensor Network library in Julia
https://bsc-quantic.github.io/Tenet.jl/
Apache License 2.0
22 stars 1 forks source link

Add `replace!` function for replacing a `Tensor` from a `TensorNetwork` #48

Closed jofrevalles closed 1 year ago

jofrevalles commented 1 year ago

Summary

Add a replace! function that allows users to replace a specific Tensor within a TensorNetwork. The function should ensure that the new Tensor maintains the same connections with respect to the labels as the original Tensor.

The replace! function should have the following input parameters and expected behavior:

Example

function replace!(state::TensorNetwork, index::Int, new_tensor::Tensor)
    # Perform checks and update the state
    ...
end