-
Notifications
You must be signed in to change notification settings - Fork 5
feature: TensorTrain <-> TreeTN conversion API #360
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
There is no public API to convert between TensorTrain<Complex64> (simplett) and TreeTN<TensorDynLen, usize> (treetn). This is the single largest usability barrier for the quanticstransform crate.
Every user who wants to apply a quantics operator must write ~100 lines of boilerplate to:
- Convert
TensorTraintoTreeTN(constructTensorDynLenwith column-major layout, handle boundary tensors, createIndexobjects) - Remap site indices to match operator input indices via
get_input_mapping - Apply the operator
- Extract results from the output TreeTN
The integration test (crates/tensor4all-quanticstransform/tests/integration_test.rs) contains helper functions (tensortrain_to_treetn, contract_treetn_to_vector) that are copy-pasted by every user.
Additional gaps
- No
TensorTrain<f64>->TensorTrain<Complex64>conversion (TCI produces f64, operators require Complex64) - No
QuanticsOperatorre-export fromquanticstransformlib.rs
Suggested API
// In tensor4all-treetn or a bridging crate:
pub fn tensortrain_to_treetn(tt: &TensorTrain<Complex64>) -> (TreeTN<TensorDynLen, usize>, Vec<Index>);
// High-level convenience:
pub fn apply_operator_to_tensortrain(op: &QuanticsOperator, tt: &TensorTrain<Complex64>) -> Result<TensorTrain<Complex64>>;Found by
Reported by 5 out of 6 automated test personas as the primary friction point.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request