'''
Created on 16-Apr-2021

@author: rishi_priyansh
'''
from xv.km.ui import SvgHelper  
import matplotlib.pyplot as plt

import random
import inspect
import traceback

from ...helper import BaseHelper

from xv.km.managers import BaseManager
from xv.km.kelements import KProblemTemplate
        
class EntanglementManager(BaseManager):
    '''
    EntanglementManager
    Example:
        ke = EntanglementManager()
        ke.getRandomProblem()
        ke.getRandomProblem(problem_type = 0)
        ...
        
        ke.printProblem()
        ke.printAnswer()
        ke.printSolution()
        
        ke.printProblemTypes()
        
    '''    
    _OPR_TYPE_COUNT = 10
    
    def __new__(cls, *args, **kwargs):
        instance = super(EntanglementManager, cls).__new__(cls, *args, **kwargs)
        for base_class in EntanglementManager.__bases__:
            base_class.__init__(instance, *args, **kwargs)
        return instance
    
    def __init__(self, *args, **kwargs):
        self.base_helper = BaseHelper(**kwargs)
        pass



    def _init_problem_types(self, *args, **kwargs):
        self._append_problem_types([
            '_problem_topics',
            ])
        pass



    def _problem_topics(self, *args, **kwargs):
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        
        statement = f"""
        topics of entanglement
        
        """
        problemTemplate.add_problem(statement.strip(), 'text/html')

        
        soln_s = f"""
        Quantum mechanics
        
        Wave function
        https://en.wikipedia.org/wiki/Wave_function
        http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/qm.html#c4
        https://www.sciencedirect.com/topics/mathematics/wavefunction-psi

        Conservation of mommentum
        
        Amplitude
        
        Spin
        
        Qubit
        
        Basis states
        
        EPR paradox
        
        Spooky action at a distance
        
        Bell's theorum
        
        Superdeterminism
        
        Hamiltionian
        
        Schrodinger's cat
        
        Superposition
        
        Decoherence
        
        Hilbert space
        
        Schrodinger equation
        
        Bohmain mechanics
        
        GRW Theory
        
        QBism
        
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')
        
        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/svg')

        return problemTemplate
        pass
    
    