


"""simple docstring"""







import qiskit




def      UpperCAmelCase__ (lowerCAmelCase_						,		lowerCAmelCase_     ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE		     =       qiskit.Aer.get_backend("aer_simulator"     )

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

					# Apply X (NOT) Gate to Qubits 0 & 1
					circuit.x(0     )
					circuit.x(1     )

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

					# Execute the circuit on the qasm simulator
					__SCREAMING_SNAKE_CASE		     =       qiskit.execute(lowerCAmelCase_						,		lowerCAmelCase_						,		shots=1000     )

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


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




"""simple docstring"""







import numpy as np
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris
from sklearn.metrics import ConfusionMatrixDisplay
from sklearn.model_selection import train_test_split
from xgboost import XGBClassifier




def      UpperCAmelCase__ (lowerCAmelCase_     ):




					'''simple docstring'''


					return (data["data"], data["target"])




def      UpperCAmelCase__ (lowerCAmelCase_						,		lowerCAmelCase_     ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE		     =       XGBClassifier()
					classifier.fit(lowerCAmelCase_						,		lowerCAmelCase_     )
					return classifier




def      UpperCAmelCase__ ():




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE		     =       load_iris()
					__SCREAMING_SNAKE_CASE     ,						__SCREAMING_SNAKE_CASE		     =       data_handling(lowerCAmelCase_     )
					__SCREAMING_SNAKE_CASE     ,						__SCREAMING_SNAKE_CASE     ,						__SCREAMING_SNAKE_CASE     ,						__SCREAMING_SNAKE_CASE		     =       train_test_split(
					    lowerCAmelCase_						,		lowerCAmelCase_						,		test_size=0.25     )

					__SCREAMING_SNAKE_CASE		     =       iris["target_names"]

					# Create an XGBoost Classifier from the training data
					__SCREAMING_SNAKE_CASE		     =       xgboost(lowerCAmelCase_						,		lowerCAmelCase_     )

					# Display the confusion matrix of the classifier with both training and test sets
					ConfusionMatrixDisplay.from_estimator(
					    lowerCAmelCase_						,		lowerCAmelCase_						,		lowerCAmelCase_						,		display_labels=lowerCAmelCase_						,		cmap="Blues"						,		normalize="true"						,		)
					plt.title("Normalized Confusion Matrix - IRIS Dataset"     )
					plt.show()


if __name__ == "__main__":
		import doctest

		doctest.testmod(verbose=True)
		main()
