Skip to content

az #1236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AZIIZALOYIBI opened this issue Apr 3, 2025 · 1 comment
Open

az #1236

AZIIZALOYIBI opened this issue Apr 3, 2025 · 1 comment

Comments

@AZIIZALOYIBI
Copy link

AZIIZALOYIBI commented Apr 3, 2025

This issue tracker is for problems with the source code repository (e.g., its structure, package file, compilation process, organization, etc.), not for problems w

iimport React, { useState } from 'react';
import { MathJaxContext, MathJax } from 'better-react-mathjax';

const QuantumEquationDisplay = () => {
  const [selectedEquation, setSelectedEquation] = useState('density');
  
  // مجموعة من المعادلات الكمية المهمة
  const quantumEquations = {
    density: "\\log(N) \\cdot \\sum_{i=1}^{n} \\frac{|\\psi_i\\rangle\\langle\\psi_i|}{d_i}",
    schrodinger: "i\\hbar \\frac{\\partial}{\\partial t}|\\psi(t)\\rangle = \\hat{H}|\\psi(t)\\rangle",
    planck: "E = h\\nu = \\frac{hc}{\\lambda}",
    uncertainty: "\\Delta x \\Delta p \\geq \\frac{\\hbar}{2}",
    entanglement: "|\\Psi\\rangle = \\frac{1}{\\sqrt{2}}(|0\\rangle_A|1\\rangle_B - |1\\rangle_A|0\\rangle_B)"
  };

  // شرح المعادلات
  const explanations = {
    density: "مصفوفة الكثافة المختلطة المعممة التي تصف حالة النظام الكمي",
    schrodinger: "معادلة شرودنجر الأساسية التي تصف تطور النظام الكمي عبر الزمن",
    planck: "معادلة بلانك للإشعاع الكمي التي تربط طاقة الفوتون بتردد الإشعاع",
    uncertainty: "مبدأ عدم اليقين لهايزنبرغ الذي يحدد الدقة القصوى لقياس الموضع والزخم معاً",
    entanglement: "حالة التشابك الكمي بين جسيمين A و B في حالة بيل المضادة للتناسق"
  };

  // دالة لتبديل المعادلات المعروضة
  const handleEquationChange = (type) => {
    setSelectedEquation(type);
  };

  return (
    <div className="mx-auto p-6 max-w-4xl bg-gray-50 rounded-lg shadow-md">
      <h2 className="text-2xl font-bold mb-4 text-right">نظرية الكم: صياغة رياضية دقيقة</h2>
      
      <div className="flex flex-wrap justify-center gap-2 mb-6">
        <button 
          onClick={() => handleEquationChange('density')}
          className={`px-3 py-1 rounded ${selectedEquation === 'density' ? 'bg-blue-600 text-white' : 'bg-gray-200'}`}
        >
          مصفوفة الكثافة
        </button>
        <button 
          onClick={() => handleEquationChange('schrodinger')}
          className={`px-3 py-1 rounded ${selectedEquation === 'schrodinger' ? 'bg-blue-600 text-white' : 'bg-gray-200'}`}
        >
          معادلة شرودنجر
        </button>
        <button 
          onClick={() => handleEquationChange('planck')}
          className={`px-3 py-1 rounded ${selectedEquation === 'planck' ? 'bg-blue-600 text-white' : 'bg-gray-200'}`}
        >
          معادلة بلانك
        </button>
        <button 
          onClick={() => handleEquationChange('uncertainty')}
          className={`px-3 py-1 rounded ${selectedEquation === 'uncertainty' ? 'bg-blue-600 text-white' : 'bg-gray-200'}`}
        >
          مبدأ عدم اليقين
        </button>
        <button 
          onClick={() => handleEquationChange('entanglement')}
          className={`px-3 py-1 rounded ${selectedEquation === 'entanglement' ? 'bg-blue-600 text-white' : 'bg-gray-200'}`}
        >
          التشابك الكمي
        </button>
      </div>

      <div className="bg-white p-6 rounded-lg mb-4 text-center shadow-inner">
        <MathJaxContext>
          <MathJax style={{ fontSize: '1.5rem' }}>{quantumEquations[selectedEquation]}</MathJax>
        </MathJaxContext>
      </div>

      <div className="bg-blue-50 p-4 rounded-lg text-right">
        <h3 className="font-medium mb-2">التفسير الرياضي:</h3>
        <p>{explanations[selectedEquation]}</p>
      </div>
    </div>
  );
};

export default QuantumEquationDisplay;

th the MathJax code itself. If you are reporting a bug in how MathJax works, please use the MathJax issue tracker, rather than this one, so that all the issues are in one place for easier searching and sorting.

If you are not part of the MathJax team, it is unlikely that you should be posting an issue here. Use the tracker linked above instead.

@dpvc
Copy link
Member

dpvc commented Apr 6, 2025

You have not explained the issue you are facing. A code snippet is not an explanation of what you are trying to do what is going wrong for you.

Also, this is filed in the wrong place. You should make an issue report in the MathJax Issue Tracker, as explained in the template for this tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants