1
$\begingroup$

How can we apply transformations to Regions in the Wolfram language?

For example, given the transformation $r_x \rightarrow r_x\sqrt{1-g}, r_y \rightarrow r_y \sqrt{1-g}, r_z \rightarrow g + r_z (1-g)$, how can one apply such transformation to a unit sphere regions representing Bloch sphere/ball ?

r = Region[Sphere[]]

Edit: What I originally meant by "show" is to take a unit sphere and then apply this transformation and see how it changes its shape/position (given that it may shrink and at the same time its center can be displaced).

$\endgroup$
3
  • 1
    $\begingroup$ I am little bit confused. You want a graphic representation of the Bloch same as given in Wikipedia page? $\endgroup$
    – sslucifer
    Sep 9 '21 at 14:27
  • 1
    $\begingroup$ It is unclear what you are asking, or if it is even related to Mathematica. "how can one show this" <- What do you mean by "this"? What do you mean by "show? (Prove?) Please rewrite the question to prevent it from getting closed. $\endgroup$
    – Szabolcs
    Sep 9 '21 at 14:29
  • $\begingroup$ The question was clear enough for me to give an acceptable answer. I have edited the question to clarify a bit and suggest we re-open it now. $\endgroup$
    – rhermans
    Sep 10 '21 at 10:42
3
$\begingroup$
Region[Sphere[]]

enter image description here

tr = With[{g=0.7},
   Composition[
   TranslationTransform[{0, 0, g}],
   ScalingTransform[{Sqrt[1-g],Sqrt[1-g],(1-g)}]
 ]
];

enter image description here

Region[
  TransformedRegion[Sphere[],tr]
  ,PlotTheme->"Detailed"
  ,PlotRange->{{-1,1},{-1,1},{-1,1}}
]

enter image description here

$\endgroup$
6
  • $\begingroup$ Thanks, @rhermans. How can one use some mesh function so that the curvature is visible clearly? $\endgroup$
    – Zubin
    Sep 9 '21 at 17:36
  • $\begingroup$ For that please ask a new question. $\endgroup$
    – rhermans
    Sep 9 '21 at 17:37
  • $\begingroup$ It would also be nice if we could put axes with the origin at x=y=z=0. $\endgroup$
    – Zubin
    Sep 9 '21 at 17:37
  • 1
    $\begingroup$ @Zubin No, while clarification and improvements in questions are desirable, here we normally consider it a bad idea to move the goalpost and add new requests to old questions. You need to ask a new question. $\endgroup$
    – rhermans
    Sep 10 '21 at 10:43
  • 1
    $\begingroup$ Okay, just asked a separate question here: mathematica.stackexchange.com/questions/255499/… $\endgroup$
    – Zubin
    Sep 10 '21 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.