microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
katas/content/linear_algebra/tensor_product/Verification.qs
17lines · modecode
| 1 | namespace Kata.Verification { |
| 2 | import Std.Math.*; |
| 3 | |
| 4 | function TensorProduct_Reference() : Double[][] { |
| 5 | return [ |
| 6 | [5., 6., 10., 12.], |
| 7 | [7., 8., 14., 16.], |
| 8 | [15., 18., 20., 24.], |
| 9 | [21., 24., 28., 32.] |
| 10 | ]; |
| 11 | } |
| 12 | |
| 13 | @EntryPoint() |
| 14 | operation CheckSolution() : Bool { |
| 15 | ArraysEqualD(Kata.TensorProduct(), TensorProduct_Reference()) |
| 16 | } |
| 17 | } |
| 18 | |