Benchmark AI / Public workspace

SciCode / 38.3 / Given some input vectors (could be one, two or three in total), provide the…

Problem

Answer published by the source. Consult the official source to check your work against its answer.

step background

Background For 1D case, the reciprocal vector is calculated as $$ \begin{gathered} \overrightarrow{a_1}=a \vec{x} \\ \overrightarrow{b_1}=\frac{2 \pi}{a_1} \vec{x} \end{gathered} $$ For 2D case, $$ \begin{aligned} & \overrightarrow{b_1}=2 \pi \frac{\overrightarrow{a_2} \times \overrightarrow{a_3}}{\overrightarrow{a_1} \cdot\left(\overrightarrow{a_2} \times \overrightarrow{a_3}\right)} \\ & \overrightarrow{b_2}=2 \pi \frac{\overrightarrow{a_3} \times \overrightarrow{a_1}}{\overrightarrow{a_1} \cdot\left(\overrightarrow{a_2} \times \overrightarrow{a_3}\right)} \end{aligned} $$ where a3\overrightarrow{a_3} is a vector that is perpendicular to the 2D plane. For 3D case, the function has been given.
Plain-text mathematical notation (without MathML)
Background

For 1D case, the reciprocal vector is calculated as
$$
\begin{gathered}
\overrightarrow{a_1}=a \vec{x} \\
\overrightarrow{b_1}=\frac{2 \pi}{a_1} \vec{x}
\end{gathered}
$$

For 2D case,
$$
\begin{aligned}
& \overrightarrow{b_1}=2 \pi \frac{\overrightarrow{a_2} \times \overrightarrow{a_3}}{\overrightarrow{a_1} \cdot\left(\overrightarrow{a_2} \times \overrightarrow{a_3}\right)} \\
& \overrightarrow{b_2}=2 \pi \frac{\overrightarrow{a_3} \times \overrightarrow{a_1}}{\overrightarrow{a_1} \cdot\left(\overrightarrow{a_2} \times \overrightarrow{a_3}\right)}
\end{aligned}
$$
where (a₃)→ is a vector that is perpendicular to the 2D plane.

For 3D case, the function has been given.
Original LaTeX notation
Background

For 1D case, the reciprocal vector is calculated as
$$
\begin{gathered}
\overrightarrow{a_1}=a \vec{x} \\
\overrightarrow{b_1}=\frac{2 \pi}{a_1} \vec{x}
\end{gathered}
$$

For 2D case,
$$
\begin{aligned}
& \overrightarrow{b_1}=2 \pi \frac{\overrightarrow{a_2} \times \overrightarrow{a_3}}{\overrightarrow{a_1} \cdot\left(\overrightarrow{a_2} \times \overrightarrow{a_3}\right)} \\
& \overrightarrow{b_2}=2 \pi \frac{\overrightarrow{a_3} \times \overrightarrow{a_1}}{\overrightarrow{a_1} \cdot\left(\overrightarrow{a_2} \times \overrightarrow{a_3}\right)}
\end{aligned}
$$
where $\overrightarrow{a_3}$ is a vector that is perpendicular to the 2D plane.

For 3D case, the function has been given.

step description prompt

Given some input vectors (could be one, two or three in total), provide the reciprocal vectors. The input should be numpy array(s), and the output should be a list of one numpy array or some numpy arrays if there are more than one vectors.

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import