from scipy.stats import kruskal, f_oneway
import pandas as pd
import numpy as np

#if p value less than alpha reject
qiskit_data = np.full(10000, 0.25)

cirq_data = np.full(10000, 0.25)

qs_data = np.full(10000, 0.25)

kruskal(qiskit_data, cirq_data, qs_data)


#if p value less than alpha reject
qiskit_data = np.full(10000, 0.75)

cirq_data = np.full(10000, 0.75)

qs_data = np.full(10000, 0.75)

kruskal(qiskit_data, cirq_data, qs_data)

qiskit_data = np.concatenate((np.full(7576, 0.375), np.full(1253, 0.3125), np.full(359, 0.4375), 
                        np.full(218, 0.25), np.full(121, 0.5), np.full(101, 0.1875),
                        np.full(66, 0.5625), np.full(57, 0.125), np.full(42, 0.625),
                        np.full(41, 0.0625), np.full(35, 0), np.full(29, 0.9375),
                        np.full(27, 0.8125), np.full(27, 0.6875), np.full(25, 0.75),
                        np.full(23, 0.875)))

print(qiskit_data)

cirq_data = np.concatenate((np.full(7610, 0.375), np.full(1208, 0.3125), np.full(377, 0.4375), 
                        np.full(235, 0.25), np.full(129, 0.5), np.full(89, 0.1875),
                        np.full(68, 0.5625), np.full(55, 0.125), np.full(36, 0.625),
                        np.full(30, 0.0625), np.full(31, 0), np.full(28, 0.9375),
                        np.full(24, 0.8125), np.full(34, 0.6875), np.full(25, 0.75),
                        np.full(21, 0.875)))

print(cirq_data)

qs_data = np.concatenate((np.full(7593, 0.375), np.full(1247, 0.3125), np.full(384, 0.4375), 
                        np.full(213, 0.25), np.full(121, 0.5), np.full(114, 0.1875),
                        np.full(61, 0.5625), np.full(35, 0.125), np.full(39, 0.625),
                        np.full(28, 0.0625), np.full(38, 0), np.full(22, 0.9375),
                        np.full(18, 0.8125), np.full(28, 0.6875), np.full(27, 0.75),
                        np.full(32, 0.875)))

print(qs_data)

kruskal(qiskit_data, cirq_data, qs_data)

qiskit_data = np.concatenate((np.full(137,0.375),  np.full(9375,0.359375),  np.full(235,0.34375),  
                                np.full(4,0.265625),  np.full(52,0.390625),  np.full(4,0.453125),  
                                np.full(58,0.328125),  np.full(15,0.296875),  np.full(10,0.421875),  
                                np.full(27,0.40625),  np.full(1,0.890625),  np.full(21,0.3125),  
                                np.full(1,0.140625),  np.full(1,0.171875),  np.full(5,0.53125),  
                                np.full(1,0.921875),  np.full(2,0.21875),  np.full(1,0),  
                                np.full(1,0.9375),  np.full(1,0.203125),  np.full(1,0.5625),  
                                np.full(4,0.234375),  np.full(1,0.59375),  np.full(1,0.09375),  
                                np.full(1,0.734375),  np.full(7,0.4375),  np.full(1,0.953125),  
                                np.full(2,0.1875),  np.full(2,0.671875),  np.full(1,0.0625),  
                                np.full(1,0.703125),  np.full(1,0.796875),  np.full(1,0.484375),  
                                np.full(11,0.28125),  np.full(2,0.15625),  np.full(2,0.609375),  
                                np.full(1,0.84375),  np.full(1,0.65625),  np.full(1,0.046875),  
                                np.full(3,0.25),  np.full(2,0.5),  np.full(1,0.46875)))

print(qiskit_data)

cirq_data = np.concatenate((np.full(143,0.375), np.full(9340,0.359375), np.full(3,0.484375), 
                                np.full(61,0.328125), np.full(13,0.40625), np.full(260,0.34375), 
                                np.full(1,0.921875), np.full(45,0.390625), np.full(13,0.421875), 
                                np.full(2,0.09375), np.full(5,0.234375), np.full(14,0.296875), 
                                np.full(3,0.4375), np.full(34,0.3125), np.full(1,0.765625), 
                                np.full(2,0.75), np.full(11,0.28125), np.full(6,0.46875), 
                                np.full(5,0.265625), np.full(2,0.140625), np.full(2,0.796875), 
                                np.full(2,0.515625), np.full(3,0.21875), np.full(2,0.703125), 
                                np.full(1,0.625), np.full(1,0.53125), 
                                np.full(1,0.984375), np.full(1,0.546875), np.full(2,0.640625), 
                                np.full(2,0.1875), np.full(2,0.15625), np.full(2,0.125), 
                                np.full(1,0.03125), np.full(1,0.859375), np.full(2,0.25), 
                                np.full(1,0.453125), np.full(3,0.046875), np.full(1,0.0625), 
                                np.full(1,0.953125), np.full(1,0.59375), np.full(1,0.90625), 
                                np.full(1,0.078125), np.full(1,0.78125), np.full(1,0.5)))

print(cirq_data)

qs_data = np.concatenate((np.full(9324,0.359375), np.full(290,0.34375), np.full(137,0.375), 
                                np.full(57,0.328125), np.full(30,0.390625), np.full(20,0.3125), 
                                np.full(18,0.296875), np.full(17,0.40625), np.full(13,0.421875), 
                                np.full(11,0.28125), np.full(10,0.4375), np.full(9,0.265625), 
                                np.full(8,0.25), np.full(6,0.453125), np.full(4,0.46875), 
                                np.full(4,0.515625), np.full(4,0.234375), np.full(3,0.5), 
                                np.full(3,0.1875), np.full(3,0.171875), np.full(2,0.125), 
                                np.full(2,0.21875), np.full(2,0.75), np.full(2,0.609375), 
                                np.full(2,0.140625), np.full(2,0.203125), np.full(1,0.53125), 
                                np.full(1,0.546875), np.full(1,0.640625), np.full(1,0.0625), 
                                np.full(1,0.78125), np.full(1,0.671875), np.full(1,0), 
                                np.full(1,0.484375), np.full(1,0.796875), np.full(1,0.921875), 
                                np.full(1,0.03125), np.full(1,0.015625), np.full(1,0.84375), 
                                np.full(1,0.578125), np.full(1,0.078125), np.full(1,0.9375), 
                                np.full(1,0.984375)))

print(qs_data)

# since we have so many 'categories' it makes more sense to run a traditional ANOVA test
f_oneway(qiskit_data, cirq_data, qs_data)

qiskit_data = np.concatenate((np.full(4969,0.71875), np.full(2,0.0546875), np.full(4,0.5078125), 
                                np.full(3171,0.7265625), np.full(48,0.6875), np.full(7,0.828125), 
                                np.full(53,0.7578125), np.full(176,0.703125), np.full(8,0.8125), 
                                np.full(406,0.734375), np.full(144,0.7421875), np.full(475,0.7109375), 
                                np.full(8,0.8359375), np.full(1,0.265625), np.full(3,0.484375), 
                                np.full(3,0.8828125), np.full(6,0.6015625), np.full(38,0.6796875), 
                                np.full(80,0.75), np.full(1,0.1640625), np.full(87,0.6953125), 
                                np.full(25,0.7734375), np.full(18,0.78125), np.full(5,0.5859375), 
                                np.full(5,0.9296875), np.full(14,0.6640625), np.full(10,0.6484375), 
                                np.full(3,0.8984375), np.full(2,0.6171875), np.full(31,0.765625), 
                                np.full(16,0.671875), np.full(14,0.7890625), np.full(4,0.8671875), 
                                np.full(7,0.625), np.full(12,0.6328125), np.full(4,0.609375), 
                                np.full(3,0.875), np.full(2,0.4765625), np.full(1,0.2734375), 
                                np.full(2,0.34375), np.full(1,0.40625), np.full(5,0.5390625), 
                                np.full(8,0.640625), np.full(6,0.796875), np.full(1,0.21875), 
                                np.full(9,0.8046875), np.full(4,0.5703125), np.full(1,0.4453125), 
                                np.full(3,0.5), np.full(1,0.046875), np.full(11,0.65625), 
                                np.full(6,0.8203125), np.full(7,0.84375), np.full(1,0.296875), 
                                np.full(2,0.015625), np.full(1,0.53125), np.full(1,0.953125), 
                                np.full(1,0.4140625), np.full(5,0.8515625), np.full(1,0.9921875), 
                                np.full(1,0.5234375), np.full(1,0.0390625), np.full(1,0.4609375), 
                                np.full(1,0.921875), np.full(4,0.59375), np.full(2,0.90625), 
                                np.full(9,0.578125), np.full(1,0.4921875), np.full(1,0.2578125), 
                                np.full(4,0.859375), np.full(1,0.4296875), np.full(1,0.5625), 
                                np.full(2,0), np.full(2,0.546875), np.full(2,0.234375), 
                                np.full(1,0.2109375), np.full(1,0.328125), np.full(3,0.890625), 
                                np.full(1,0.171875), np.full(1,0.375), np.full(4,0.9375), 
                                np.full(1,0.9609375), np.full(1,0.15625), np.full(1,0.390625), 
                                np.full(2,0.0859375), np.full(3,0.3984375), np.full(1,0.9140625), 
                                np.full(1,0.2265625), np.full(1,0.109375), np.full(1,0.203125), 
                                np.full(1,0.515625)))

print(qiskit_data)

cirq_data = np.concatenate((np.full(5010,0.71875), np.full(3207,0.7265625), np.full(372,0.734375),
                                np.full(32,0.765625), np.full(153,0.7421875), np.full(164,0.703125),
                                np.full(28,0.7734375), np.full(19,0.671875), np.full(454,0.7109375),
                                np.full(5,0.8828125), np.full(19,0.6640625), np.full(78,0.6953125),
                                np.full(11,0.7890625), np.full(1,0.3515625), np.full(8,0.640625),
                                np.full(38,0.6875), np.full(88,0.75), np.full(10,0.65625),
                                np.full(3,0.59375), np.full(45,0.7578125), np.full(3,0.328125), 
                                np.full(3,0.5234375), np.full(3,0.6171875), np.full(40,0.6796875), 
                                np.full(6,0.84375), np.full(9,0.6328125), np.full(1,0.359375), 
                                np.full(2,0.4296875), np.full(2,0.515625), np.full(6,0.5546875), 
                                np.full(13,0.796875), np.full(4,0.8671875), np.full(5,0.6015625), 
                                np.full(2,0.09375), np.full(10,0.8046875), np.full(2,0.1796875), 
                                np.full(4,0.5625), np.full(12,0.78125), np.full(7,0.828125), 
                                np.full(12,0.8203125), np.full(3,0.859375), np.full(3,0.875), 
                                np.full(1,0.4609375), np.full(4,0.578125), np.full(2,0.984375), 
                                np.full(3,0.96875), np.full(1,0.3359375), np.full(5,0.890625), 
                                np.full(8,0.625), np.full(5,0.8359375), np.full(3,0.171875), 
                                np.full(3,0.8515625), np.full(12,0.6484375), np.full(2,0.453125), 
                                np.full(1,0.90625), np.full(2,0.3828125), np.full(5,0.53125), 
                                np.full(1,0.1953125), np.full(1,0.03125), np.full(2,0.953125), 
                                np.full(1,0.34375), np.full(3,0.8125), np.full(1,0.0078125), 
                                np.full(1,0.9609375), np.full(1,0.0234375), np.full(2,0.609375), 
                                np.full(1,0.1015625), np.full(1,0.921875), np.full(3,0.9140625), 
                                np.full(7,0.546875), np.full(1,0.5703125), np.full(2,0.25), 
                                np.full(1,0.5), np.full(1,0.0703125), np.full(2,0.9765625), 
                                np.full(2,0.9453125), np.full(1,0.2890625), np.full(1,0.046875), 
                                np.full(1,0.9296875), np.full(1,0.8984375), np.full(1,0.203125), 
                                np.full(2,0.484375), np.full(2,0.5859375), np.full(1,0.2578125),
                                np.full(1,0.2109375), np.full(1,0.21875))) 


print(cirq_data)

qs_data = np.concatenate((np.full(4903,0.71875), np.full(3204,0.7265625), np.full(466,0.7109375), 
                                np.full(427,0.734375), np.full(162,0.703125), np.full(160,0.7421875),
                                np.full(95,0.6953125), np.full(78,0.75), np.full(56,0.6875), 
                                np.full(41,0.6796875), np.full(38,0.7578125), np.full(30,0.765625), 
                                np.full(24,0.671875), np.full(21,0.65625), np.full(20,0.7734375),
                                np.full(16,0.78125), np.full(15,0.8046875), np.full(14,0.6640625), 
                                np.full(14,0.6484375), np.full(13,0.7890625), np.full(11,0.796875), 
                                np.full(9,0.640625), np.full(8,0.8203125), np.full(6,0.6171875), 
                                np.full(6,0.6328125), np.full(5,0.8359375), np.full(5,0.8125), 
                                np.full(5,0.625), np.full(5,0.953125), np.full(5,0.5859375), 
                                np.full(4,0.9140625), np.full(4,0.609375), np.full(4,0.6015625), 
                                np.full(4,0.84375), np.full(4,0.875), np.full(4,0.8828125), 
                                np.full(4,0.59375), np.full(4,0.828125), np.full(4,0.5234375),
                                np.full(3,0.90625), np.full(3,0.8984375), np.full(3,0.859375), 
                                np.full(3,0.9765625), np.full(3,0.1171875), np.full(3,0.5625), 
                                np.full(3,0.03125), np.full(3,0.8515625), np.full(3,0.21875),
                                np.full(3,0.4921875), np.full(3,0.546875), np.full(2,0.515625), 
                                np.full(2,0.5390625), np.full(2,0.375), np.full(2,0.3125), 
                                np.full(2,0.9296875), np.full(2,0.8671875), np.full(2,0.53125), 
                                np.full(2,0.234375), np.full(2,0.5546875), np.full(2,0.0703125),
                                np.full(2,0.203125), np.full(2,0.921875), np.full(2,0.5), 
                                np.full(2,0.5703125), np.full(2,0.3203125), np.full(2,0.046875),
                                np.full(2,0.171875), np.full(2,0.9453125), np.full(2,0.3984375), 
                                np.full(1,0.484375), np.full(1,0.4140625), np.full(1,0.9375), 
                                np.full(1,0.15625), np.full(1,0.96875), np.full(1,0.421875),
                                np.full(1,0.46875), np.full(1,0.4296875), np.full(1,0.9921875), 
                                np.full(1,0.109375), np.full(1,0.1328125), np.full(1,0.1796875), 
                                np.full(1,0.4765625), np.full(1,0.1015625), np.full(1,0.2890625),
                                np.full(1,0.078125), np.full(1,0.265625), np.full(1,0.1953125),
                                np.full(1,0.0078125), np.full(1,0.25), np.full(1,0.453125), 
                                np.full(1,0), np.full(1,0.390625), np.full(1,0.09375), 
                                np.full(1,0.5078125), np.full(1,0.890625), np.full(1,0.4609375),
                                np.full(1,0.984375), np.full(1,0.3359375), np.full(1,0.0859375), 
                                np.full(1,0.2734375)))

print(qs_data)

# since we have so many 'categories' it makes more sense to run a traditional ANOVA test
f_oneway(qiskit_data, cirq_data, qs_data)