Skip to content

This Mathematica notebook can be used to classically simulate deep quantum neural networks.

Notifications You must be signed in to change notification settings

peixinshen/DeepQuantumNeuralNetworks-Mathematica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

DeepQuantumNeuralNetworks-Mathematica

Language View notebooks

This Mathematica notebook can be used to classically simulate deep quantum neural networks as proposed in

K. Beer, D. Bondarenko, T. Farrelly, T. J. Osborne, R. Salzmann, and R. Wolf. Training deep quantum neural networks. Nat Commun 11, 808 (2020).

Compared to the original repo of the authors, this code has been rewritten in a more Mathematica-like fashion. In addition, its efficiency has also been dramatically improved, as we introduce a new function for the Partial Trace:

PartialTrace[densityMatrix_, traceList_, quditDim_ : 2] := 
    Module[{t = Flatten@{traceList}, qubitNum = Log[quditDim, Length@densityMatrix]}, 
        ArrayReshape[
            TensorContract[
                ArrayReshape[
                    densityMatrix, Table[quditDim, 2 qubitNum]
                ], Table[{i, i + qubitNum}, {i, t}]
            ], {quditDim^(qubitNum - Length@t), quditDim^(qubitNum - Length@t)}
        ]
    ]

This is the very initial version, detailed comments of the code will be updated in the near future.

About

This Mathematica notebook can be used to classically simulate deep quantum neural networks.

Resources

Stars

Watchers

Forks

Releases

No releases published