


import unittest

from knapsack import greedy_knapsack as kp

class  __A       (  unittest.TestCase      ):


				def _snake_case    (						self							):
								lowerCamelCase			=[10, 20, 30, 40, 50, 60]
								lowerCamelCase			=[2, 4, 6, 8, 10, 12]
								lowerCamelCase			=100
								self.assertEqual(kp.calc_profit(UpperCAmelCase_				,	UpperCAmelCase_				,	UpperCAmelCase_							)				,	210							)


				def _snake_case    (						self							):
								self.assertRaisesRegex(UpperCAmelCase_				,	"""max_weight must greater than zero."""							)


				def _snake_case    (						self							):
								self.assertRaisesRegex(UpperCAmelCase_				,	"""Weight can not be negative."""							)


				def _snake_case    (						self							):
								self.assertRaisesRegex(UpperCAmelCase_				,	"""Profit can not be negative."""							)


				def _snake_case    (						self							):
								self.assertRaisesRegex(UpperCAmelCase_				,	"""max_weight must greater than zero."""							)


				def _snake_case    (						self							):
								self.assertRaisesRegex(
								    UpperCAmelCase_				,	"""The length of profit and weight must be same."""							)


if __name__ == "__main__":
							unittest.main()












import qiskit





def        _lowercase   (  _UpperCAmelCase     , _UpperCAmelCase			)  ->					qiskit.result.counts.Counts:
				lowerCamelCase			=qiskit.Aer.get_backend("""aer_simulator"""			)

				# Create a Quantum Circuit acting on the q register
				lowerCamelCase			=qiskit.QuantumCircuit(_UpperCAmelCase     , _UpperCAmelCase			)

				# Map the quantum measurement to the classical bits
				circuit.measure([0]     , [0]			)

				# Execute the circuit on the simulator
				lowerCamelCase			=qiskit.execute(_UpperCAmelCase     , _UpperCAmelCase     , shots=10_00			)

				# Return the histogram data of the results of the experiment.
				return job.result().get_counts(_UpperCAmelCase			)


if __name__ == "__main__":
							print(F"Total count for various states are: {single_qubit_measure(1, 1)}")





