Skip to content
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

[Bug] 矩阵显示错误 #3436

Closed
1 of 3 tasks
coffee-guy opened this issue Dec 4, 2023 · 5 comments
Closed
1 of 3 tasks

[Bug] 矩阵显示错误 #3436

coffee-guy opened this issue Dec 4, 2023 · 5 comments

Comments

@coffee-guy
Copy link

coffee-guy commented Dec 4, 2023

Describe the bug
gpr4-1106-preview
latex语法显示出错

gpt回复内容:
一个三阶酉矩阵的例子可以是以下矩阵:

[ U = \begin{bmatrix}
\frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}} \
0 & 1 & 0 \
\frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}
\end{bmatrix} ]

为了验证这个矩阵确实是酉的,我们需要检查它是否满足 ( U^{\dagger}U = UU^{\dagger} = I ),其中 ( I ) 是三阶单位矩阵。

首先,计算 ( U^{\dagger} )(U 的共轭转置):

[ U^{\dagger} = \begin{bmatrix}
\frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}} \
0 & 1 & 0 \
\frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}
\end{bmatrix}^{\dagger} = \begin{bmatrix}
\frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}} \
0 & 1 & 0 \
\frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}
\end{bmatrix} ]

(注意:在这个特殊的例子中,矩阵 U 的元素都是实数,所以共轭转置只涉及转置。)

接下来,计算 ( U^{\dagger}U ) 和 ( UU^{\dagger} ):

[ U^{\dagger}U = \begin{bmatrix}
\frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}} \
0 & 1 & 0 \
\frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}
\end{bmatrix} \begin{bmatrix}
\frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}} \
0 & 1 & 0 \
\frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}
\end{bmatrix} = \begin{bmatrix}
1 & 0 & 0 \
0 & 1 & 0 \
0 & 0 & 1
\end{bmatrix} = I ]

[ UU^{\dagger} = \begin{bmatrix}
\frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}} \
0 & 1 & 0 \
\frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}
\end{bmatrix} \begin{bmatrix}
\frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}} \
0 & 1 & 0 \
\frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}
\end{bmatrix} = \begin{bmatrix}
1 & 0 & 0 \
0 & 1 & 0 \
0 & 0 & 1
\end{bmatrix} = I ]

由于 ( U^{\dagger}U ) 和 ( UU^{\dagger} ) 都等于单位矩阵 I,我们可以确认这个矩阵 U 是酉的。

To Reproduce
Steps to reproduce the behavior:

  1. 提问gpt4 turbo
  2. 给我一个三阶酉矩阵的例子
  3. 矩阵latex显示出错

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

bug

Deployment

  • Docker
  • Vercel
  • Server

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional Logs
Add any logs about the problem here.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Matrix display error

@H0llyW00dzZ
Copy link
Contributor

it's model issue related #3351

@coffee-guy
Copy link
Author

it's model issue related #3351

i use gpt4-1106-preview

@Yidadaa
Copy link
Collaborator

Yidadaa commented Dec 6, 2023

OpenAI 为了避免 LaTex 的公式符号与美元 $ 符号冲突,使用 [] 作为公式语法,所以会出现这种情况,虽然现在可以通过调整 prompts 来解决,但未来需要提交代码,来彻底解决这个问题。

#3239

@Yidadaa Yidadaa closed this as completed Dec 6, 2023
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


In order to avoid conflicts between LaTex formulas and the dollar sign, OpenAI uses [] as the formula syntax, so this situation occurs. Although it can be solved by adjusting prompts now, code needs to be submitted in the future to completely solve this problem.

#3239

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

4 participants