Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Cytnx documentation
Logo
Cytnx documentation
  • Introduction
  • Install & Usage of Cytnx
  • Advanced Install of Cytnx
  • Function Naming convention
  • User Guide
    • 1. Objects behavior
    • 2. Device
    • 3. Tensor
      • 3.1. Creating a Tensor
      • 3.2. Manipulating Tensors
      • 3.3. Accessing elements
      • 3.4. Tensor arithmetic
      • 3.5. To/From numpy.array
      • 3.6. Appending elements
      • 3.7. Save/Load a Tensor
      • 3.8. When will data be copied?
    • 4. Storage
      • 4.1. Creating a Storage
      • 4.2. Accessing elements
      • 4.3. Increase size
      • 4.4. From/To C++.vector
      • 4.5. Save/Load a storage
    • 5. Scalar
    • 6. Tensor notation
    • 7. UniTensor
      • 7.1. Print and display
      • 7.2. Creating a UniTensor
      • 7.3. Changing labels
      • 7.4. Bond
      • 7.5. Tagged UniTensor
      • 7.6. UniTensor with Symmetries
      • 7.7. Accessing the block(s)
      • 7.8. Get/set UniTensor element
      • 7.9. Manipulate UniTensor
      • 7.10. Save/Load a UniTensor
    • 8. Contraction
      • 8.1. Network
      • 8.2. Contract(s)
      • 8.3. ncon
    • 9. Linear algebra
    • 10. Iterative solver
      • 10.1. LinOp class
      • 10.2. Lanczos solver
    • 11. linalg extension
    • 12. Common APIs
  • Examples
    • 1. Exact Diagonalization
    • 2. iTEBD
    • 3. DMRG
    • 4. iDMRG
  • Common usage
    • 1. Set same value for all blocks in UniTensor with Symmetry
    • 2. Check current Blas/Lapack integer size
  • Performance tuning
    • Tensordot with input cache
    • Access single element of Tensor in C++
  • API Documentation
  • Github
  • 5-mins Blitz intro slide
  • Developer
Back to top
View this page

3. Tensor¶

Tensor is the basic building block of Cytnx. In fact, the API of Tensor in Cytnx is very similar to torch.tensor (and to numpy.array, since they are also similar to each other).

Let’s take a look on how to use it:

  • 3.1. Creating a Tensor
  • 3.2. Manipulating Tensors
  • 3.3. Accessing elements
  • 3.4. Tensor arithmetic
  • 3.5. To/From numpy.array
  • 3.6. Appending elements
  • 3.7. Save/Load a Tensor
  • 3.8. When will data be copied?
Next
3.1. Creating a Tensor
Previous
2. Device
Copyright © 2019-, Kai-Hsin Wu
Made with Sphinx and @pradyunsg's Furo