In this PR, I have added a new file qtensor.py which contains the class QTensor. This class was needed to ease the implementation of mathematical objects like vectors, matrices, and tensors. This class has been derived from numpy.ndarray and thus, all the linear algebraic operations that can be performed on an ndarray can be performed on a QTensor object. Besides, applying any function on a QTensor object, compiling, simulating, or taking the grad of a QTensor object can be done in the same way as is done for a tequila objective.
Apart from that, I have also added test_qtensor.py file which contains tests for this class.
For more details on the usage and implementation of QTensor, I have also added two notebooks in tequila-tutorials:
In this PR, I have added a new file
qtensor.py
which contains the classQTensor
. This class was needed to ease the implementation of mathematical objects like vectors, matrices, and tensors. This class has been derived fromnumpy.ndarray
and thus, all the linear algebraic operations that can be performed on an ndarray can be performed on a QTensor object. Besides, applying any function on a QTensor object, compiling, simulating, or taking the grad of a QTensor object can be done in the same way as is done for a tequila objective. Apart from that, I have also addedtest_qtensor.py
file which contains tests for this class.For more details on the usage and implementation of QTensor, I have also added two notebooks in
tequila-tutorials
:QTensorTutorial.ipynb
- https://github.com/tequilahub/tequila-tutorials/blob/main/QTensorTutorial.ipynbQTensorImplementation.ipynb
- https://github.com/tequilahub/tequila-tutorials/blob/main/QTensorImplementation.ipynb